When we pass the following Java code into regnant:
public class NullCheck {
public static void main(String[] args){
String s = null;
assert(s != null);
}
}
The current implementation of regnant will output code which looks like this:
NullCheck_main(){
ifnull null then {
fail;
}else{
return 0
}
}
{ NullCheck_main() }
ifnull null seems to be the cause of the error.
However, modifying the semantics of ConSORT seems to mess with ownership and may cause issues.
Modifying how ConditionExpr gets treated with null literals in regnant (src/main/java/edu/kyoto/fos/regnant/translation/Translate.java ) outputs the following ConSORT:
NullCheck_main(){
{
fail;
return 0
}
}
{ NullCheck_main() }
This also fails with line 2, col 2 in file mono.imp: Dead code.
There's probably a better way to generate the code when we hit this case so that we don't generate the "dead code".
When we pass the following Java code into regnant:
The current implementation of regnant will output code which looks like this:
ifnull nullseems to be the cause of the error.However, modifying the semantics of ConSORT seems to mess with ownership and may cause issues.
Modifying how
ConditionExprgets treated with null literals in regnant (src/main/java/edu/kyoto/fos/regnant/translation/Translate.java) outputs the following ConSORT:This also fails with
line 2, col 2 in file mono.imp: Dead code.There's probably a better way to generate the code when we hit this case so that we don't generate the "dead code".