This commit is contained in:
Araq 2015-08-09 23:21:44 +02:00
commit bbf9757b4e

View file

@ -898,6 +898,8 @@ proc getBody*(s: PSym): PNode =
## it may perform an expensive reload operation. Otherwise it's a simple ## it may perform an expensive reload operation. Otherwise it's a simple
## accessor. ## accessor.
assert s.kind in routineKinds 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] result = s.ast.sons[bodyPos]
if result == nil: if result == nil:
assert s.offset != 0 assert s.offset != 0