extern env & ti

This commit is contained in:
dzaima 2021-05-24 00:37:43 +03:00
parent 39f9060224
commit f4ec365a3e
4 changed files with 9 additions and 4 deletions

View File

@ -408,7 +408,7 @@ typedef struct TypeInfo {
bool isArr; bool isArr;
bool arrD1; // is always an array with depth 1 bool arrD1; // is always an array with depth 1
} TypeInfo; } TypeInfo;
TypeInfo ti[t_COUNT]; extern TypeInfo ti[t_COUNT];
#define TI(x) (ti[v(x)->type]) #define TI(x) (ti[v(x)->type])

View File

@ -12,6 +12,7 @@ FOR_PM1(F)
#define F(N,X) B bi_##N; #define F(N,X) B bi_##N;
FOR_PM2(F) FOR_PM2(F)
#undef F #undef F
TypeInfo ti[t_COUNT];
B rtPerf_wrap(B x); // consumes B rtPerf_wrap(B x); // consumes

View File

@ -99,6 +99,10 @@ void printBC(i32* p) {
B catchMessage; B catchMessage;
u64 envPrevHeight; u64 envPrevHeight;
Env* envCurr;
Env* envStart;
Env* envEnd;
B* gStack; // points to after end B* gStack; // points to after end
B* gStackStart; B* gStackStart;
B* gStackEnd; B* gStackEnd;

View File

@ -63,9 +63,9 @@ B m_md2Block(Block* bl, Scope* psc);
Env* envCurr; extern Env* envCurr;
Env* envStart; extern Env* envStart;
Env* envEnd; extern Env* envEnd;
static inline void pushEnv(Scope* sc, i32* bc) { static inline void pushEnv(Scope* sc, i32* bc) {
if (envCurr==envEnd) thrM("Stack overflow"); if (envCurr==envEnd) thrM("Stack overflow");