Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using NimNode in run-time code crashes the compiler #1395

Open
zerbina opened this issue Aug 3, 2024 · 0 comments
Open

using NimNode in run-time code crashes the compiler #1395

zerbina opened this issue Aug 3, 2024 · 0 comments
Labels
bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler

Comments

@zerbina
Copy link
Collaborator

zerbina commented Aug 3, 2024

Using the NimNode type, either directly (e.g., as the type of a variable) or indirectly (e.g., by calling a procedure that returns a NimNode), in a run-time context crashes the compiler when building with --gc:arc or --gc:orc.

Example

# top-level code
var x: NimNode

Actual Output

compiler crashes with a segmentation fault

Expected Output

Error: cannot use `NimNode` in a non-compile-time-only context

Possible Solution

sem needs to report an error when a "triggers compile-time" type (such as NimNode) is used in a context that's not compile-time only.

@zerbina zerbina added bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler labels Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler
Projects
None yet
Development

No branches or pull requests

1 participant