-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.
Milestone
Description
Zig Version
0.10.0-dev.4217+9d8cdb855
Steps to Reproduce
const std = @import("std");
const expect = std.testing.expect;
test {
var x: [10][10]u32 = undefined;
x[0][1] = 0;
const a = x[0];
x[0][1] = 15;
try expect(a[1] == 0);
}Expected Behavior
Test should pass (passes in stage1).
Actual Behavior
error: TestUnexpectedResult
/Users/toadman667/repos/zig/lib/std/testing.zig:347:14: 0x10448d83f in expect (test4)
if (!ok) return error.TestUnexpectedResult;
^
./test4.zig:41:5: 0x10448d9d2 in main (test4)
try expect(a[1] == 0);
^The problem is that .array_elem_val returns a pointer to the element without doing a side effect check like what's done in airLoad
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backend-llvmThe LLVM backend outputs an LLVM IR Module.The LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.regressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.