nim-works / nimskull

An in development statically typed systems programming language; with sustainability at its core. We, the community of users, maintain it.
https://nim-works.github.io/nimskull/index.html
Other
275 stars 39 forks source link

fix: crash when passing NimNode to static parameter #1449

Closed zerbina closed 1 month ago

zerbina commented 1 month ago

Summary

Details

There were two problems:

For handling NimNode values in vm.regToNode, the existing deserialization logic for NimNode values in vmcompilerserdes is moved to a separate procedure, so that it can be used by regToNode.

The opcRepr implementation relied on regToNode always returning an unwrapped PNode -- it is adjusted to manually handle NimNode values.

A test covering both issues is added.

Fixes https://github.com/nim-works/nimskull/issues/1448.

saem commented 1 month ago

/merge

github-actions[bot] commented 1 month ago

Merge requested by: @saem

Contents after the first section break of the PR description has been removed and preserved below: