bootstrappable: constant pointer arithmetic.

This commit is contained in:
Jan Nieuwenhuizen 2017-09-10 12:52:46 +02:00
parent 28e321133a
commit 0c66456b1f
3 changed files with 16 additions and 1 deletions

4
tcc.c
View File

@ -251,6 +251,10 @@ int main(int argc, char **argv)
unsigned start_time = 0;
const char *first_file;
#if BOOTSTRAP //MESC bug
vstack = &__vstack[1];
#endif
redo:
s = tcc_new();
opt = tcc_parse_args(s, &argc, &argv, 1);

10
tcc.h
View File

@ -1313,7 +1313,15 @@ ST_DATA CType char_pointer_type, func_old_type, int_type, size_type;
ST_DATA SValue __vstack[1+/*to make bcheck happy*/VSTACK_SIZE];
ST_DATA SValue *vtop;
ST_DATA SValue *pvtop;
#define vstack (__vstack + 1)
#if BOOTSTRAP
#if __MESC__
SValue *vstack;
#else
extern SValue *vstack;
#endif
#else
#define vstack (__vstack + 1)
#endif
ST_DATA int rsym, anon_sym, ind, loc;
ST_DATA int const_wanted; /* true if constant wanted */

View File

@ -28,6 +28,9 @@
rsym: return symbol
anon_sym: anonymous symbol index
*/
#if BOOTSTRAP //MESC
SValue *vstack;
#endif
ST_DATA int rsym, anon_sym, ind, loc;
ST_DATA Sym *sym_free_first;