wcc/check: #23 reject untyped-int into nested-union variant (wwstage align to cstage)
isassignable's untyped-int arm fell through *confident=false/return true, silently accepting an untyped int into a union whose variant is itself a nested (non-flattened) union; ww emitted tag=0 (wrong arm) where cstage louds. Reject unless a direct variant is numeric-or-enum (N_TENUM accept mirrors cstage type_isnum). Faithful flatten+rebox deferred (nominal identity, post-CSP). test/wcc/835 (new) + Makefile.
This commit is contained in:
7
Makefile
7
Makefile
@@ -259,6 +259,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_overlong_arrlit \
|
||||
$(BIN)/test_tuple_elem_overlong \
|
||||
$(BIN)/test_tagged_arr_variant \
|
||||
$(BIN)/test_nested_union_int_box \
|
||||
$(BIN)/test_inferred_array_global \
|
||||
$(BIN)/test_slice_str_global_arg \
|
||||
$(BIN)/test_slice_str_global_zero \
|
||||
@@ -730,6 +731,12 @@ $(BIN)/test_tagged_arr_variant: test/wcc/834_tagged_arr_variant.c $(BIN)/ww \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BIN)/test_nested_union_int_box: test/wcc/835_nested_union_int_box.c $(BIN)/ww \
|
||||
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
|
||||
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BIN)/test_inferred_array_global: test/wcc/833_inferred_array_global.c $(BIN)/ww \
|
||||
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
|
||||
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
|
||||
|
||||
Reference in New Issue
Block a user