mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
This code will crash `check`/`nimsuggest` since the `ra` register is
uninitialised
```nim
import macros
static:
discard parseExpr("'")
```
Now it assigns an empty node so that it has something
Testament changes were so I could properly write a test. It would pass
even with a segfault since it could find the error
16 lines
283 B
Nim
16 lines
283 B
Nim
discard """
|
|
action: "reject"
|
|
cmd: "nim check $file"
|
|
errormsg: "expected expression, but got multiple statements [ValueError]"
|
|
file: "macros.nim"
|
|
"""
|
|
|
|
import macros
|
|
static:
|
|
discard parseStmt("'")
|
|
discard parseExpr("'")
|
|
discard parseExpr("""
|
|
proc foo()
|
|
proc foo() = discard
|
|
""")
|