jasmin
jasmin copied to clipboard
No check that we do not call an export function
If we try to call an export function, we do not get a clear message "cannot call an export function". Instead, we can get:
- an assertion false in
regalloc.ml
export fn f(reg u64 arg) -> reg u64 {
reg u64 res;
res = arg;
return res;
}
export fn main () -> reg u64 {
reg u64 res x;
x = 2;
res = f (res);
res += x;
return res;
}
- the error
linearisation: (one_varmap) nowhere to store the return address
export fn f(reg u64 arg) -> reg u64 {
reg u64 res;
res = arg;
return res;
}
export fn main () -> reg u64 {
reg u64 res;
res = f (res);
return res;
}
Current version says:
typing error: call to export function needs to be inlined
Can this be closed?
Indeed, the error message is now clear.