diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-11-28 16:32:02 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-11-28 16:32:02 -0800 |
commit | 1f56c99181f31314b26757307170fca0c9808cf3 (patch) | |
tree | 9b043183ff20427c36f04cb52b651cd9452ca9b3 /mu.arc | |
parent | bfc5fe9e0df6aeba7dc12e9138305a2be5dc8c91 (diff) | |
download | mu-1f56c99181f31314b26757307170fca0c9808cf3.tar.gz |
359 - 'sizeof' supports 'deref' pointers
Just non-arrays for now.
Diffstat (limited to 'mu.arc')
-rw-r--r-- | mu.arc | 7 |
1 files changed, 6 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 |