-
Notifications
You must be signed in to change notification settings - Fork 34
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
Error: 'invoke' is not GC-safe as it performs an indirect call here #71
Comments
Can you give me some code to test? |
This will never compile with |
I think you found a regression bug of the nim compiler. Nim compiler 1.2.x don't have this problem. And the line that compiler complain about is surely gcsafe. A quick workaround is change Or just mark these two lines as {.gcsafe.}. {.gcsafe.}:
if cast[pointer](excep.pfnDeferredFillIn).notNil:
discard excep.pfnDeferredFillIn(&excep) |
Somehow, no matter how I tried to use it like that, it never worked with more than a single line. |
Fixed. |
@khchen sorry to message here but getting the same errors for another function when building with
|
winim/winim/com.nim
Lines 1000 to 1002 in b7b3260
I had trouble with GC safety in my application and the root cause was located in the place seen above.
The actual execution is marked as
{.gcsafe.}
, however the "indirect execution" to find out, if the valueisNil
, is not.My quick fix for this issue is the following:
Not sure, if this is a good solution, so I wanted to open an Issue and get feedback, before opening any Pull Request.
The text was updated successfully, but these errors were encountered: