-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Regression: SIGSEGV caused by using is
with string
#8129
Comments
The issue seems to be that the string if t1.kind == tyTypeDesc and t2.kind != tyTypeDesc: trying to access edit: as a matter of fact |
That check is guarded by internalAssert c.config,
n.sonsLen == 3 and
n[1].typ != nil and
n[2].kind in {nkStrLit..nkTripleStrLit, nkType} This means that
CC @zah since he touched this proc last |
Ah, thanks @LemonBoy! I'll create a PR for that. let t2 = semTypeNode(c, n[2], nil)
n.sons[2] = newNodeIT(nkType, n[2].info, t2) in the if n[2].kind notin {nkStrLit..nkTripleStrLit}: Should the call be to edit: ok, I see now that |
…#8129 In case the second son of the node in `semIs` is of kind `strLit`, we now call `semExprWithType` to set the `typ` field of that node. Also removes the `t2 != tyTypeDesc` check in `isOpImpl`, since the kind of `n[2]` is already assertet with the `internalAssert`.
In case the second son of the node in `semIs` is of kind `strLit`, we now call `semExpr` to set the `typ` field of that node. Also removes the `t2 != tyTypeDesc` check in `isOpImpl`, since the kind of `n[2]` is already assertet with the `internalAssert`.
In case the second son of the node in `semIs` is of kind `strLit`, we now call `semExpr` to set the `typ` field of that node. Also removes the `t2 != tyTypeDesc` check in `isOpImpl`, since the kind of `n[2]` is already assertet with the `internalAssert`.
* call `semExpr` in `semIs` if node is `strLit`, fixes #8129 In case the second son of the node in `semIs` is of kind `strLit`, we now call `semExpr` to set the `typ` field of that node. Also removes the `t2 != tyTypeDesc` check in `isOpImpl`, since the kind of `n[2]` is already assertet with the `internalAssert`. * reintroduce check for `t2.kind != tyTypeDesc` to fix test case The `internalAssert` in the `isOpImpl` doesn't check `n.sons[2].typ.kind` as I previously read, but rather `n.sons[2].kind`. Therefore the check for `tyTypeDesc` here is useful. Otherwise the last test case in `isopr.nim` fails. Also removes the flag `efDetermineType` from the call to `semExpr`.
I had code similar to
in a library from when I was learning Nim. Trying to compile on the most recent devel causes a SIGSEGV during compilation.
koch
outputs:While
is
andisnot
should be used on types as I know nowadays, this should still not crash the compiler. The regression is also introduced by the recent typedesc merge of: #7681The text was updated successfully, but these errors were encountered: