mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
refs #2377
This commit is contained in:
@@ -898,6 +898,8 @@ proc getBody*(s: PSym): PNode =
|
||||
## it may perform an expensive reload operation. Otherwise it's a simple
|
||||
## accessor.
|
||||
assert s.kind in routineKinds
|
||||
# prevent crashes due to incorrect macro transformations (bug #2377)
|
||||
if s.ast.isNil or bodyPos >= s.ast.len: return ast.emptyNode
|
||||
result = s.ast.sons[bodyPos]
|
||||
if result == nil:
|
||||
assert s.offset != 0
|
||||
|
||||
Reference in New Issue
Block a user