Skip to content

Commit

Permalink
properly fold constants for dynlib pragma (#22575)
Browse files Browse the repository at this point in the history
fixes #12929
  • Loading branch information
metagn committed Aug 28, 2023
1 parent 3de8d75 commit 6b955ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/pragmas.nim
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ proc expectDynlibNode(c: PContext, n: PNode): PNode =
# {.dynlib: myGetProcAddr(...).}
result = c.semExpr(c, n[1])
if result.kind == nkSym and result.sym.kind == skConst:
result = result.sym.astdef # look it up
result = c.semConstExpr(c, result) # fold const
if result.typ == nil or result.typ.kind notin {tyPointer, tyString, tyProc}:
localError(c.config, n.info, errStringLiteralExpected)
result = newEmptyStrNode(c, n)
Expand Down

0 comments on commit 6b955ac

Please sign in to comment.