wcc/cgen: route same-type tagged-cast return through the widener (wwstage align to cstage)
A same-type tagged cast return (`return x: u`, u == fnret) emitted tag=0 (a 2nd-variant value returned the wrong payload). Route it through the widener (needswiden when N_CAST && ru1==fu1, beside S1's ru1!=fu1) which peels the identity cast internally -> correct; same-type non-cast stays on the passthrough. Byte-id-neutral. test/wcc/837.
This commit is contained in:
7
Makefile
7
Makefile
@@ -261,6 +261,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
|
||||
$(BIN)/test_tagged_arr_variant \
|
||||
$(BIN)/test_nested_union_int_box \
|
||||
$(BIN)/test_tagged_assignable_cluster \
|
||||
$(BIN)/test_idcast_tagged_return \
|
||||
$(BIN)/test_inferred_array_global \
|
||||
$(BIN)/test_slice_str_global_arg \
|
||||
$(BIN)/test_slice_str_global_zero \
|
||||
@@ -744,6 +745,12 @@ $(BIN)/test_tagged_assignable_cluster: test/wcc/836_tagged_assignable_cluster.c
|
||||
$(LIB)/libwwrt.a | $(BIN)
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BIN)/test_idcast_tagged_return: test/wcc/837_idcast_tagged_return.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