Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,656 changes: 3,328 additions & 3,328 deletions BOOTSTRAP/cli.c

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ dev: install-production
#lm --showalloc SRC/unit-tctx-core.lsts > out.txt
#lm --showalloc SRC/unit-prop-core.lsts > out.txt
#lm --showalloc SRC/unit-ascript-core.lsts > out.txt
lm --showalloc --v23 SRC/index.lsts > out.txt
#lm --showalloc SRC/index.lsts > out.txt
lm tests/promises/typechecking/misc-linear-error-1.lsts

build: compile-production
time env $(LSTSFLAGS) ./production --v23 --c -o deploy1.c SRC/index.lsts
Expand Down
4 changes: 1 addition & 3 deletions PLUGINS/BACKEND/C/std-c-compile-expr.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ let std-c-compile-expr(ctx: FContext, t: AST, is-stmt: Bool): Fragment = (
f = f.set(c"frame",
f.get(c"frame") + pre + SAtom(c" ")
+ v.get(c"expression")
+ SAtom(c" ") + post + SAtom(c";")
+ SAtom(c"memset(&") + v.get(c"expression")
+ SAtom(c",0,sizeof(") + v.get(c"expression") + SAtom(c"));")
+ SAtom(c" ") + post + SAtom(c"={0};")
);
};
match rhs {
Expand Down
2 changes: 2 additions & 0 deletions SRC/typecheck-infer-expr.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ let std-infer-expr(tctx: Maybe<TypeContext>, term: AST, is-scoped: Bool, used: I
};
if non-zero(term-phi-id) and term-phi-id != t-phi-id then tctx = tctx.phi-move(typeof-term(t), t);
if non-zero(term-phi-id) and term-phi-id != f-phi-id then tctx = tctx.phi-move(typeof-term(f), f);
if (typeof-term(term).is-t(c"Nil",0) or typeof-term(term).is-t(c"Never",0)) and non-zero(t-phi-id) then tctx = tctx.phi-move(typeof-term(t), t);
if (typeof-term(term).is-t(c"Nil",0) or typeof-term(term).is-t(c"Never",0)) and non-zero(f-phi-id) then tctx = tctx.phi-move(typeof-term(f), f);
}
);
ASTEOF{} => tctx = tctx.ascript(term, t0(c"Nil"));
Expand Down
7 changes: 1 addition & 6 deletions SRC/typecheck-infer-type-definition.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,7 @@ let infer-type-yield-constructor(base-type: Type, case-tag: CString, case-number
body = mk-cons(body, mk-lit(c" ").ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-lit(return-id).ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-app(mk-var(c"mangle-post"),mk-atype(t1(c"Type",base-type))) );
body = mk-cons(body, mk-lit(c";").ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-lit(c"memset(&").ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-lit(return-id).ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-lit(c",0,sizeof ").ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-lit(return-id).ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-lit(c");").ascript(t0(c"L") && t0(c"Literal")));
body = mk-cons(body, mk-lit(c"={0};").ascript(t0(c"L") && t0(c"Literal")));

if has-tag-case {
body = mk-cons(body, mk-lit(return-id).ascript(t0(c"L") && t0(c"Literal")) );
Expand Down
6 changes: 6 additions & 0 deletions tests/promises/typechecking/misc-linear-error-1.lsts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

import lib/core/bedrock.lsts;

let f(): Nil = (
if true then "";
);
Loading