Fix conditional compilation not skipping #emit directives

#emit directives inside #if ... #endif blocks were processed by the
compiler regardless of the condition.

--------- test code --------

main() {
	#if 0
		#emit halt 1
	#endif
}

----- end of test code -----
This commit is contained in:
Zeex 2014-08-31 12:18:37 +07:00
parent e0a61e5f93
commit 6aa5ae3b00

View File

@ -1228,6 +1228,7 @@ static int command(void)
break;
#if !defined NOEMIT
case tpEMIT: {
if (!SKIPPING) {
/* write opcode to output file */
char name[40];
int i;
@ -1294,6 +1295,7 @@ static int command(void)
} /* if */
stgwrite("\n");
check_empty(lptr);
} /* if */
break;
} /* case */
#endif