diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-11-08 10:20:49 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-11-08 10:20:49 -0800 |
commit | f4647409b5fa658e463424c0a8249a4d72405d59 (patch) | |
tree | ff024555e70a2cb8649dbf7f494129d670997676 /020run.cc | |
parent | 2789e86118e1f4da63e5b8883ffdb4ef31c98887 (diff) | |
download | mu-f4647409b5fa658e463424c0a8249a4d72405d59.tar.gz |
3652
size_of(type_tree*) is a mess; clean it up with an eye to the final tangled version.
Diffstat (limited to '020run.cc')
-rw-r--r-- | 020run.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/020run.cc b/020run.cc index 746bc9cd..de957dbb 100644 --- a/020run.cc +++ b/020run.cc @@ -329,6 +329,16 @@ int size_of(const reagent& r) { } int size_of(const type_tree* type) { if (!type) return 0; + if (type->atom) { + if (type->value == -1) return 1; // error value, but we'll raise it elsewhere + if (type->value == 0) return 1; + // End size_of(type) Atom Special-cases + } + else { + assert(type->left->atom); + if (type->left->name == "address") return 1; + // End size_of(type) Non-atom Special-cases + } // End size_of(type) Special-cases return 1; } |