You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using self-built nim from git. I tested the following with 0062077 . The problem appeared only after I upgraded from 07d7d35 (I did not see the problem with 07d7d35 and the same code).
I write this code:
type QCbase* {.importc.} = ref object of RootObj
num1* {.importc.}: float
str2* {.importc.}: cstring
proc newQCbase*() : QCbase {.importcpp:"new QCbase".}
let inst1 : QCbase = newQCbase()
And compile it with nim js -o:testNim2.js testNim2.nim, I get an error:
Hint: used config file 'C:\msys64\home\Andi\work\g\Nim\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: testnim2 [Processing]
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
I do NOT get the error if I instead use the code:
type QCbase* {.importc.} = ref object of RootObj
num1* {.importc.}: float
str2* {.importc.}: cstring
proc newQCbase*() : QCbase {.importcpp:"new QCbase(@)".}
let inst1 : QCbase = newQCbase()
With the difference being the (@).
I also do not get a segfault if I compile with nim c instead of nim js.
I am using self-built nim from git. I tested the following with 0062077 . The problem appeared only after I upgraded from 07d7d35 (I did not see the problem with 07d7d35 and the same code).
I write this code:
And compile it with
nim js -o:testNim2.js testNim2.nim
, I get an error:I do NOT get the error if I instead use the code:
With the difference being the
(@)
.I also do not get a segfault if I compile with
nim c
instead ofnim js
.This might be related to the fix for #4496
The text was updated successfully, but these errors were encountered: