Fixed compilation of test32() from runnable/template1

This commit is contained in:
Alexey Prokhin
2011-07-19 19:42:41 +04:00
parent ce799e9974
commit f97fd92433

View File

@@ -756,8 +756,19 @@ bool hasNonConstPointers(Expression *e)
}
if (e->type->ty== Tpointer && e->type->nextOf()->ty != Tfunction)
{
#if IN_LLVM
// address of a global is OK
if (e->op == TOKaddress || e->op == TOKcast)
return false;
if (e->op == TOKadd || e->op == TOKmin) {
BinExp *be = (BinExp*)e;
if (be->e1->type->ty == Tpointer || be->e2->type->ty == Tpointer)
return false;
}
#else
if (e->op == TOKsymoff) // address of a global is OK
return false;
#endif
if (e->op == TOKint64) // cast(void *)int is OK
return false;
if (e->op == TOKstring) // "abc".ptr is OK