summaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-30 18:34:52 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-30 18:40:02 -0700
commit594223c2959cc116ccc2782ebf7930677b053843 (patch)
tree82781e9646db2e51b0f096753fb49533fa8d7c2c /6
parent093716ff5e2ffe837793ba7c9239c64e22789ec0 (diff)
downloadmc-594223c2959cc116ccc2782ebf7930677b053843.tar.gz
Add hook into frontend for sizeof() folding.
Before, code like: const f = { var buf: byte[sizeof(int)] } would crash us, because `sizeof` would not get folded. A slightly subtle point: muse doens't install a hook here, but since it's already handling processed usefiles, the array sizes should already be prefolded for its viewing pleasure.
Diffstat (limited to '6')
-rw-r--r--6/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/6/main.c b/6/main.c
index 7ce7d5f..ab93660 100644
--- a/6/main.c
+++ b/6/main.c
@@ -202,6 +202,7 @@ main(int argc, char **argv)
optinit(&ctx, "cd:?hSo:I:9G:O:", argv, argc);
asmsyntax = Defaultasm;
+ sizefn = size;
while (!optdone(&ctx)) {
switch (optnext(&ctx)) {
case 'O':