refs #2377
This commit is contained in:
parent
50861792f4
commit
bbf9757b4e
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue