Skip to content

Instantly share code, notes, and snippets.

View owensd's full-sized avatar

David Owens II owensd

View GitHub Profile
@owensd
owensd / grit.md
Created August 28, 2026 17:02
RADDBG Claude Review

C1 — DWARF stack-manipulation opcodes are collectively broken

src/dwarf/dwarf_expr.c:156-160 Four of the five stack ops are wrong: dup and over push zero, swap is an identity, rot is a 1↔3 swap (gaffes-and-perf.md#G2-G4, and C2 below). Any location or CFA expression using them silently yields a wrong address — wrong variable values and wrong unwinds on ELF targets. Nothing in src/dwarf/tests covers them. Fix: correct all four; add expression-level tests asserting final stack contents.

C2 — DW_OP_rot implements a reversal, not a rotation

src/dwarf/dwarf_expr.c:159

case DW_ExprOp_Rot: {push_vals[0] = popped_vals[0]; push_vals[1] = popped_vals[1]; push_vals[2] = popped_vals[2];}break;
{
"attacks": [
{
"attackBonus": "strengthMod + proficiencyBonus",
"charId": "34HGdP9BywJezCywL",
"color": "q",
"damage": "1d8 + {strengthMod}",
"damageType": "slashing",
"enabled": true,
"name": "Cone of Cold",
@owensd
owensd / composite.swift
Created November 29, 2016 17:05
Full playground posting for blog post: Composite Validators - Refined
//: Playground - noun: a place where people can play
import Cocoa
enum Result<ValueType> {
case ok(ValueType)
case error(Error)
}
protocol Validator {
@owensd
owensd / protocols.swift
Created October 1, 2015 17:55
Need some help
//: Playground - noun: a place where people can play
import Cocoa
enum Error : ErrorType {
case NIY
}
protocol LangValue {
mutating func set(object object: LangValue, forKey key: String) throws
enum Keys: String {
case uniqueID = "uniqueID"
}
Keys.uniqueID
extension Array {
func first() -> T {
return self[0]
}
func last() -> T {
return self[self.count - 1]
}
}
struct SPerson {
var name: String
init(_ name: String) { self.name = name }
}
class CPerson {
var name: String
init(_ name: String) { self.name = name }
}
// playground1 contents
// import Foundation
let items = [4, 2.3] // this is of type Array<Double>
// playground2 contents
import Foundation
let items = [4, 2.3] // this is of type NSArray
NSDictionary *dict = @{ @"key1: @"value1",
@"key2: @"value2",
// ...
@"keyN: @"valueN" };
class MyDoubleDouble : FloatLiteralConvertible {
var double : Double
init(_ value: Double) {
double = value * 2
}
class func convertFromFloatLiteral(value: Double) -> MyDoubleDouble {
return MyDoubleDouble(value)
}