gbrault / picoc

Automatically exported from code.google.com/p/picoc
1 stars 0 forks source link

#define within a #include file from interactive mode crashes #190

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've tested this under both Linux and Max OS X with crashes under each system. 
Under OS X, I've tested several versions and not found it to work under any... 
tested: 603, 595, 580, 562, 520.

What steps will reproduce the problem?
[root@linux picoc-603]# cat includeme.h 
#define DEFINE_ME 1

[root@linux picoc-603]# ./picoc -i
starting picoc v2.2 beta r
picoc> #define DEFINE_ME_FIRST 1
picoc> #include "includeme.h"
Segmentation fault (core dumped)
[root@linux picoc-603]# 

What is the expected output? What do you see instead?
Expected output is that there should be no output. The test include file, 
includeme.h, has only a single line, a simple #define (as seen in the paste 
above). If the essential content of this file is typed at the interactive 
prompt then there is no problem, but if the file is #include'd instead, the 
#define causes picoc to crash. If the #define is removed or commented out, the 
crash does not occur.

Original issue reported on code.google.com by m...@heilpern.com on 10 Feb 2014 at 4:49