jasmin
jasmin copied to clipboard
Combination of flags passed as an argument triggers an internal error
fn zero(reg bool b) -> reg u64 {
reg u64 res tmp;
res = 0;
tmp = 1;
res = tmp if b;
return res;
}
export
fn main(reg u64 x) -> reg u64 {
reg u64 result;
reg bool b;
?{"<="=b} = #TEST(x, x);
result = zero(b);
return result;
}
triggers
line 15 (2-19):
internal compilation error in function main:
stack allocation: get_Pvar: variable expected
b is turned as some point into some flag combination, while stack allocation expects just a single variable.
Do we want to allow boolean arguments/return values to local functions?
I think in some cases, this can be useful. At least, this is tested in the test-suite.
But it does not seem to be used in libjade at the moment.