-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
Sail's assert() prints the file and line/column numbers but only if you don't add a message. I wonder if it should just always print them?
Currently the RISC-V model has this mess:
// This is all over the place:
internal_error(__FILE__, __LINE__, "should be unreachable");
val internal_error : forall ('a : Type). (string, int, string) -> 'a
function internal_error(file, line, s) = {
assert (false, file ^ ":" ^ dec_str(line) ^ ": " ^ s);
throw Error_internal_error()
}
It's pretty annoying to have to manually write __FILE__, __LINE__ (I think every time I've written this I copy/pasted it from somewhere else).
Also I don't know why it does a throw after assert(false). Can Sail asserts be disabled?
A built in unreachable("message") that is equivalent to assert(false, "message") would be neat too, given how many internal_error() calls we have.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels