VLA bcheck works via bound alloca; add test, remove warning

This commit is contained in:
Joe Soroka
2011-04-06 15:27:45 -07:00
parent 810aca9e68
commit c94f80502e
2 changed files with 34 additions and 4 deletions

View File

@ -5213,9 +5213,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
sec = NULL;
#ifdef CONFIG_TCC_BCHECK
if (tcc_state->do_bounds_check && (type->t & VT_ARRAY)) {
if (type->t & VT_VLA)
warning("Array bound check don't work for VLA");
else
if (!(type->t & VT_VLA))
loc--;
}
#endif