vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.13k stars 135 forks source link

Memory error for extra #endif #242

Open tueda opened 6 years ago

tueda commented 6 years ago

Valgrind error for an extra #endif (of course this is an error of the user)

#ifdef `A'
#message A is defined
#endif
#endif
.end
FORM 4.2.0 (Oct 26 2017, v4.2.0-22-g954024f) 64-bits  Run: Thu Nov 23 17:42:37 2017
    #ifdef `A'
    #message A is defined
    #endif
    #endif
==20384== Conditional jump or move depends on uninitialised value(s)
==20384==    at 0x4B20CA: DoEndif (pre.c:3204)
==20384==    by 0x4AF3B8: PreProInstruction (pre.c:1156)
==20384==    by 0x4AFF20: PreProcessor (pre.c:931)
==20384==    by 0x4E8EE9: main (startup.c:1605)
==20384== 
test.frm Line 5 ==> #endif without corresponding #if
    .end

I think I encountered a case that FORM completely ignored an extra #endif in a more complicated code yesterday, but now is not reproducible perhaps due to the undefined behaviour that may depends on memory status of the machine.