1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-31 23:53:02 +00:00

Fix bug in compiler with if form under certain conditions.

Begin bundled 'cook' tool for managing janet projects.
This commit is contained in:
Calvin Rose
2018-12-25 15:32:42 -05:00
parent 2c94aa1a6a
commit 17283241ab
8 changed files with 136 additions and 72 deletions

View File

@@ -369,8 +369,9 @@ static JanetSlot janetc_if(JanetFopts opts, int32_t argn, const Janet *argv) {
falsebody = truebody;
truebody = temp;
}
janetc_scope(&tempscope, c, 0, "if-body");
target = janetc_value(bodyopts, truebody);
janetc_scope(&tempscope, c, 0, "if-true");
right = janetc_value(bodyopts, truebody);
if (!drop && !tail) janetc_copy(c, target, right);
janetc_popscope(c);
janetc_throwaway(bodyopts, falsebody);
janetc_popscope(c);