You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can currently reproduce this with arrays initialized as undefined and arrays returned by @typeName and string literals but not with arrays initialized from literals.
(gdb) run run /mnt/c/dev/test.zig
Starting program: /mnt/c/dev/zig/build-linux/zig run /mnt/c/dev/test.zig
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x0000000009269e57 in const_values_equal (g=0x10b01620, a=0x10b22900, b=0x420) at /mnt/c/dev/zig/src/analyze.cpp:6876
6876 if (a->type->id != b->type->id) return false;
(gdb) bt
#0 0x0000000009269e57 in const_values_equal (g=0x10b01620, a=0x10b22900, b=0x420) at /mnt/c/dev/zig/src/analyze.cpp:6876
#1 0x0000000009207c7b in ir_analyze_instruction_slice (ira=0x10bfa1e0, instruction=0x10bf8f20) at /mnt/c/dev/zig/src/ir.cpp:27265
#2 0x0000000009213e0b in ir_analyze_instruction_base (ira=0x10bfa1e0, instruction=0x10bf8f20) at /mnt/c/dev/zig/src/ir.cpp:30521
#3 0x0000000009214899 in ir_analyze (codegen=0x10b01620, old_exec=0x10bf4670, new_exec=0x10bfa130, expected_type=0x10b1d070, expected_type_source_node=0x0, result_ptr=0x10b22220)
at /mnt/c/dev/zig/src/ir.cpp:30724
#4 0x00000000091d184c in ir_eval_const_value (codegen=0x10b01620, scope=0x10b51af0, node=0x10b52410, return_ptr=0x10b22220, backward_branch_count=0x7ffffffed138,
backward_branch_quota=0x7ffffffed140, fn_entry=0x0, c_import_buf=0x0, source_node=0x10b52410, exec_name=0x0, parent_exec=0x0, expected_type_source_node=0x0, undef_allowed=UndefBad)
at /mnt/c/dev/zig/src/ir.cpp:13353
#5 0x0000000009257901 in analyze_const_value (g=0x10b01620, scope=0x10b51af0, node=0x10b52410, type_entry=0x10b1d070, type_name=0x0, undef=UndefBad) at /mnt/c/dev/zig/src/analyze.cpp:1141
#6 0x000000000925f8f1 in resolve_decl_comptime (g=0x10b01620, tld_comptime=0x10b52670) at /mnt/c/dev/zig/src/analyze.cpp:3610
#7 0x000000000926176d in resolve_top_level_decl (g=0x10b01620, tld=0x10b52670, source_node=0x0, allow_lazy=false) at /mnt/c/dev/zig/src/analyze.cpp:4215
#8 0x00000000092643a5 in semantic_analyze (g=0x10b01620) at /mnt/c/dev/zig/src/analyze.cpp:5069
#9 0x000000000918e02e in gen_root_source (g=0x10b01620) at /mnt/c/dev/zig/src/codegen.cpp:9772
#10 0x00000000091927e2 in codegen_build_and_link (g=0x10b01620) at /mnt/c/dev/zig/src/codegen.cpp:10886
#11 0x0000000009161e3a in main0 (argc=3, argv=0x7ffffffedbd8) at /mnt/c/dev/zig/src/main.cpp:1671
#12 0x00000000091629be in main (argc=3, argv=0x7ffffffedbd8) at /mnt/c/dev/zig/src/main.cpp:1858
(gdb) f 0
#0 0x0000000009269e57 in const_values_equal (g=0x10b01620, a=0x10b22900, b=0x420) at /mnt/c/dev/zig/src/analyze.cpp:6876
6876 if (a->type->id != b->type->id) return false;
(gdb) p b
$1 = (ZigValue *) 0x420
The text was updated successfully, but these errors were encountered:
Vexu
added
bug
Observed behavior contradicts documented or intended behavior
stage1
The process of building from source via WebAssembly and the C backend.
labels
May 5, 2020
alexnask
changed the title
Taking a slice of a certain comptime arrays with a sentinel causes the compiler to segfault
Taking a slice of certain comptime arrays with a sentinel causes the compiler to segfault
May 5, 2020
I can currently reproduce this with arrays initialized as undefined and arrays returned by
@typeName
and string literals but not with arrays initialized from literals.gdb backtrace
The text was updated successfully, but these errors were encountered: