diff options
-rw-r--r-- | mu.arc | 7 | ||||
-rw-r--r-- | mu.arc.t | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/mu.arc b/mu.arc index 6e59ed1a..5c1b0455 100644 --- a/mu.arc +++ b/mu.arc @@ -686,7 +686,12 @@ typeinfo.x!array) (return (+ 1 (* (m `(,v.x integer)) (sizeof typeinfo.x!elem))))) - (let type (if acons.x ty.x x) + (let type (if (and acons.x (pos 'deref metadata.x)) + typeinfo.x!elem ; deref pointer + acons.x + ty.x + :else ; naked type + x) (assert types*.type "sizeof: no such type @type") (if (~or types*.type!record types*.type!array) types*.type!size diff --git a/mu.arc.t b/mu.arc.t index 01e130f1..0c85f4a8 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -762,6 +762,8 @@ (prn "F - 'sizeof' works on record operands")) (if (~is 3 (sizeof '(34 integer-point-pair))) (prn "F - 'sizeof' works on record operands with record fields")) +(if (~is 2 (sizeof '(34 integer-boolean-pair-address deref))) + (prn "F - 'sizeof' works on pointers to records")) (= memory*.4 23) (if (~is 24 (sizeof '(4 integer-array))) |