diff --git a/xenomorph/xenomorph/redo/struct.rkt b/xenomorph/xenomorph/redo/struct.rkt index ad1433be..e666d039 100644 --- a/xenomorph/xenomorph/redo/struct.rkt +++ b/xenomorph/xenomorph/redo/struct.rkt @@ -91,8 +91,9 @@ https://github.com/mbutterick/restructure/blob/master/src/Struct.coffee 'parent parent 'val val 'pointerSize 0)) - - (d:dict-set! ctx 'pointerOffset (+ (pos port) (if (xenomorphic? val) (size val #f ctx) 0))) + + ; deliberately use `xstruct-size` instead of `size` to use extra arg + (d:dict-set! ctx 'pointerOffset (+ (pos port) (xstruct-size xs val ctx #f))) (for ([(key type) (d:in-dict (xstruct-fields xs))]) (encode type (d:dict-ref val key) port #:parent ctx))