LLVM/MIR: Use the same pretty-printer consistently in structural mismatch errors - #3261
LLVM/MIR: Use the same pretty-printer consistently in structural mismatch errors#3261RyanGlScott wants to merge 1 commit into
Conversation
…atch errors This should minimize some spurious differences in expected/actual when displaying structural mismatch errors arising from overrides. Still not perfect by any means, but an improvement nonetheless.
|
Alas, this isn't as easy as I thought it would be. Three test cases fail with panics of the form: I'll mark this as a draft for now, as I'm not sure what is causing this. |
|
It looks at least plausible that it might be linked to |
|
Are the panics happening within the calls to |
|
Yes, the calls to For what it's worth, nothing about // test.rs
pub fn f(_p: &i32, _q: &i32) {}
pub fn g() {
let x: i32 = 1;
let y: i32 = 2;
f(&x, &y);
let xs = [1, 2, 3];
f(&xs[0], &xs[1]);
} |
|
Interestingly, if I translate this program into something equivalent-looking in C: // test.c
#include <stdint.h>
void f(int32_t* p, int32_t* q) {}
void g(void) {
int32_t x = 1;
int32_t y = 2;
f(&x, &y);
int32_t xs[3] = {1, 2, 3};
f(&xs[0], &xs[1]);
}Then SAW does not panic. The plot thickens. |
|
I think this comes down to the fact that SAW has more checks for To explain what I mean in a bit more detail, consider the override machinery that runs when you attempt to match an override that uses saw-script/saw-central/src/SAWCentral/Crucible/MIR/Override.hs Lines 1338 to 1365 in adfe651 The recursive call to As it turns out, this is caused by the call to Contrast this with the LLVM-oriented override machinery for saw-script/saw-central/src/SAWCentral/Crucible/LLVM/Override.hs Lines 1204 to 1210 in adfe651
I don't yet have a bright idea for how to fix things on the MIR side, but I wanted to record this while it was fresh on my mind. |
This should minimize some spurious differences in expected/actual when displaying structural mismatch errors arising from overrides. Still not perfect by any means, but an improvement nonetheless.