Commit Graph

5 Commits

Author SHA1 Message Date
ringabout
f6651e6c70 fixes #26045; #26046; when nimvm leak push options (#26047)
fixes #26045; 
fixes #26046

The fix isolates compiler option state while semantically checking each
when nimvm branch.

compiler/semexprs.nim:2745 snapshots the option stack, compiler options,
diagnostics settings, and enabled features. It analyzes one branch and
restores that state in finally. Both the nimvm and else branches use
this function.

This prevents:

```nim
when nimvm:
  {.push overflowChecks: off.}
```

from disabling overflow checks in following runtime code. It also means
a {.pop.} in the opposite branch correctly reports that it has no
corresponding {.push.}.
2026-08-03 11:49:48 +02:00
Bung
04c48e3c5b fix #19426 compile error using when/elif/else and typedesc in template (#20550) 2022-10-21 09:26:46 +02:00
Can Lehmann
2102e3b02f Fix #12517 Allow single branch when nimvm statements (#20577)
Allow single branch when statements
2022-10-17 08:01:53 +02:00
ringabout
3dbf2ac946 remove echo statements in tests (part 1) (#20178)
* remove echo statements

* Update tests/vm/triangle_array.nim

* Update tests/vm/tyaytypedesc.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-23 19:28:51 +02:00
Saem Ghani
2aba116bbc when statements branches exit early (#17143)
When statement branches exit early outside of nimvm. In nimvm it seems that all
sides of the branches must be evaluated as the code gen happens at a later
stage, this remains intact.
2021-02-22 12:27:23 +01:00