Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vm/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4273,7 +4273,7 @@ mod tests {
#[test]
fn proxy_generic_field_access_uses_ctype_layout() {
let value = run_source(
"Object _Extend: True With: { ifTrue: t IfFalse: f = { t call } }. Object _Extend: False With: { ifTrue: t IfFalse: f = { f call } }. CType := { parent* = Object. scalarTag: tag Size: s Align: a = { { parent* = self. impl = tag. size = s. align = a } }. struct: d = { self _CTypeBuildStruct: d } }. CUInt8 := CType scalarTag: 3 Size: 1 Align: 1. CUInt32 := CType scalarTag: 7 Size: 4 Align: 4. CTiny := CType struct: { a = CUInt8. b = CUInt32. c = CUInt8 }. Proxy := { parent* = Object. fromCType: t = { { parent* = Proxy. ctype = t. backing = ByteArray _CloneWithSize: (t size) } }. u8At: i = { (self backing) _ByteArrayU8At: i }. u32At: i = { (self backing) _ByteArrayU32At: i }. u8At: i Put: v = { (self backing) _ByteArrayU8At: i Put: v }. u32At: i Put: v = { (self backing) _ByteArrayU32At: i Put: v }. readCType: t At: offset = { ((t _CTypeScalarTag) _FixnumEq: 3) ifTrue: [ self u8At: offset ] IfFalse: [ self u32At: offset ] }. writeCType: t At: offset Value: value = { ((t _CTypeScalarTag) _FixnumEq: 3) ifTrue: [ self u8At: offset Put: value ] IfFalse: [ self u32At: offset Put: value ] }. atField: name = { info := (self ctype) _CTypeFieldInfoAt: name. self readCType: (info type) At: (info offset) }. atField: name Put: value = { info := (self ctype) _CTypeFieldInfoAt: name. self writeCType: (info type) At: (info offset) Value: value. value } }. p := Proxy fromCType: CTiny. p atField: \"a\" Put: 7. p atField: \"b\" Put: 1234. p atField: \"c\" Put: 9. ((p atField: \"a\") _FixnumAdd: (p atField: \"b\")) _FixnumAdd: (p atField: \"c\")",
"trueObj := (1 _FixnumEq: 1). falseObj := (1 _FixnumEq: 2). Object _Extend: trueObj With: { ifTrue: t IfFalse: f = { t call } }. Object _Extend: falseObj With: { ifTrue: t IfFalse: f = { f call } }. CType := { parent* = Object. scalarTag: tag Size: s Align: a = { { parent* = self. impl = tag. size = s. align = a } }. struct: d = { self _CTypeBuildStruct: d } }. CUInt8 := CType scalarTag: 3 Size: 1 Align: 1. CUInt32 := CType scalarTag: 7 Size: 4 Align: 4. CTiny := CType struct: { a = CUInt8. b = CUInt32. c = CUInt8 }. Proxy := { parent* = Object. fromCType: t = { { parent* = Proxy. ctype = t. backing = ByteArray _CloneWithSize: (t size) } }. u8At: i = { (self backing) _ByteArrayU8At: i }. u32At: i = { (self backing) _ByteArrayU32At: i }. u8At: i Put: v = { (self backing) _ByteArrayU8At: i Put: v }. u32At: i Put: v = { (self backing) _ByteArrayU32At: i Put: v }. readCType: t At: offset = { ((t _CTypeScalarTag) _FixnumEq: 3) ifTrue: [ self u8At: offset ] IfFalse: [ self u32At: offset ] }. writeCType: t At: offset Value: value = { ((t _CTypeScalarTag) _FixnumEq: 3) ifTrue: [ self u8At: offset Put: value ] IfFalse: [ self u32At: offset Put: value ] }. atField: name = { info := (self ctype) _CTypeFieldInfoAt: name. self readCType: (info type) At: (info offset) }. atField: name Put: value = { info := (self ctype) _CTypeFieldInfoAt: name. self writeCType: (info type) At: (info offset) Value: value. value } }. p := Proxy fromCType: CTiny. p atField: \"a\" Put: 7. p atField: \"b\" Put: 1234. p atField: \"c\" Put: 9. ((p atField: \"a\") _FixnumAdd: (p atField: \"b\")) _FixnumAdd: (p atField: \"c\")",
)
.expect("interpret error");
assert!(value.is_fixnum());
Expand Down
Loading