Read from string return null out of bounds (#10596)
* reading charcodes from strings as inverse of printchar * made it actually work and tested it * make reading invalid index of string return null instead of 0
This commit is contained in:
@@ -579,7 +579,7 @@ public class LExecutor{
|
||||
output.isobj = fromVar.isobj;
|
||||
}
|
||||
}else if(target.isobj && target.objval instanceof CharSequence str){
|
||||
output.setnum(address < 0 || address >= str.length() ? 0 : (int)str.charAt(address));
|
||||
output.setnum(address < 0 || address >= str.length() ? Double.NaN : (int)str.charAt(address));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user