summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBung <crc32@qq.com>2022-10-13 12:39:43 +0800
committerGitHub <noreply@github.com>2022-10-13 06:39:43 +0200
commit169d3fda0020ec5c904f70f9026a2d3bd59f9599 (patch)
treea47171425541d2684867e6ee4835fe1940f1864d
parenta1a9d63d22ec072bbfc1555610c5fd8b881f083d (diff)
downloadNim-169d3fda0020ec5c904f70f9026a2d3bd59f9599.tar.gz
fix #18136 tests/proc/t17157.nim now gives SIGSEGV instead of error (#20555)
-rw-r--r--compiler/semtypes.nim1
-rw-r--r--tests/proc/t17157.nim1
2 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 8b1abdd01..e254965c9 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1257,6 +1257,7 @@ proc newProcType(c: PContext; info: TLineInfo; prev: PType = nil): PType =
   result.n.add newNodeI(nkEffectList, info)
 
 proc isMagic(sym: PSym): bool =
+  if sym.ast == nil: return false
   let nPragmas = sym.ast[pragmasPos]
   return hasPragma(nPragmas, wMagic)
 
diff --git a/tests/proc/t17157.nim b/tests/proc/t17157.nim
index 2927eeee8..020e93fce 100644
--- a/tests/proc/t17157.nim
+++ b/tests/proc/t17157.nim
@@ -1,6 +1,5 @@
 discard """
   errormsg: "'untyped' is only allowed in templates and macros or magic procs"
-  disabled: true
 """
 
 template something(op: proc (v: untyped): void): void =