-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
async: Using switch result in expression leads to invalid llvm #4188
Copy link
Copy link
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Milestone
Description
This works:
// Wait until the first byte is received
var n = try serial.read(in_buf[0..1]);
const r = serial.readUntilTimeout(in_buf[1..], 100) catch |err| switch (err) {
error.Timeout => serial.rx_index,
else => return err,
};
n += r;
but this doesn't
// Wait until the first byte is received
var n = try serial.read(in_buf[0..1]);
// Read the rest (if any)
n += serial.readUntilTimeout(in_buf[1..], 100) catch |err| switch (err) {
error.Timeout => serial.rx_index,
else => return err,
};
the error is:
Semantic Analysis [174/623] broken LLVM module found: Instruction does not dominate all uses!
%169 = load i32, i32* %51, align 4, !dbg !4213
%168 = phi i32 [ %160, %SwitchEnd ], [ %169, %UnwrapErrOk ], !dbg !4213
Signature
pub fn readUntilTimeout(self: *UART, buffer: []u8, timeout: u32) !usize {It happens even if I use else=> 0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior