Hrm.. if tempdecl _is_ null, then we're not going to reach this code because line 359 would end up segfaulting, no?  Seems like there's some ordering issues with this logic.  And the pattern is repeated several times below.