From bbf9757b4e70c7a11701656bc7755d7d76669dad Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 9 Aug 2015 23:21:44 +0200 Subject: [PATCH] refs #2377 --- compiler/rodread.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rodread.nim b/compiler/rodread.nim index 92ce002409..e4530c2cc9 100644 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -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