diff options
Diffstat (limited to '6')
-rw-r--r-- | 6/main.c | 6 | ||||
-rw-r--r-- | 6/simp.c | 9 |
2 files changed, 14 insertions, 1 deletions
@@ -41,6 +41,7 @@ usage(char *prog) printf("\t-o\tOutput to outfile\n"); printf("\t-O dir\tOutput to dir\n"); printf("\t-S\tGenerate assembly source alongside object code\n"); + printf("\t-T\tCompile in test mode\n"); printf("\t-c\tEnable additional (possibly flaky) checking\n"); printf("\t-I path\tAdd 'path' to use search path\n"); printf("\t-d\tPrint debug dumps. Recognized options: f r p i\n"); @@ -200,7 +201,7 @@ main(int argc, char **argv) outfile = NULL; - optinit(&ctx, "cd:?hSo:I:9G:O:", argv, argc); + optinit(&ctx, "cd:?hSo:I:9G:O:T", argv, argc); asmsyntax = Defaultasm; sizefn = size; while (!optdone(&ctx)) { @@ -240,6 +241,9 @@ main(int argc, char **argv) case 'I': lappend(&incpaths, &nincpaths, ctx.optarg); break; + case 'T': + allowhidden++; + break; default: usage(argv[0]); exit(0); @@ -1006,6 +1006,15 @@ capture(Simp *s, Node *n, Node *dst) envsz->expr.type = tyintptr; assignat(s, e, 0, envsz); assignat(s, fp, 0, e); + } else { + /* + * We need to zero out the environment, so that + * duplicating the function doesn't think we have + * a bogus environment. + */ + e = mkintlit(n->loc, 0); + e->expr.type = tyintptr; + assignat(s, fp, 0, e); } assignat(s, fp, Ptrsz, f); return dst; |