Closed Simn closed 10 years ago
class Main { static public function main() { var s:String = null; if (s != null && getChar(s)) { } } static function getChar(s:String) { return s.indexOf("s") == 1; } }
The main compiles as:
void Main_main(){ String* s;int _g16; s = NULL; _g16 = Main_getChar(s); if(String_equals(s,NULL) != 1 && _g16){ } }
This causes a crash because Main_getChar(s) is evaluated.
This now compiles correctly:
void Main_main(){ String* s; s = NULL; if(((String_equals(s,NULL) != 1) ? Main_getChar(s) : 0)){ } }
The main compiles as:
This causes a crash because Main_getChar(s) is evaluated.