From: Markus H. <ma...@ti...> - 2009-11-19 09:48:59
|
Hi, I have the following java code: if(args==null){ System.out.println(1); }else{ try{ System.out.println(2); } catch(Exception e){ System.out.println(3); } } It gets converted to the following ObjectiveC code (only relevant part here) if (_op1.o != [NSNull null]) goto label0; _op1.o = [java_lang_System _GET_out]; _stack[_sp++].o = _op1.o; _stack[_sp++].i = 1; _sp -= 2; [((java_io_PrintStream*) _stack[_sp].o) println___int:_stack[_sp + 1].i]; goto label1; @try { label0:; _op1.o = [java_lang_System _GET_out]; _stack[_sp++].o = _op1.o; _stack[_sp++].i = 2; _sp -= 2; [((java_io_PrintStream*) _stack[_sp].o) println___int:_stack[_sp + 1].i]; } @catch (java_lang_Exception* _ex) { _stack[_sp++].o = _ex; goto label7; } This code crashes. The label0 is inside the try and the code jumps into it from the outside. This seems not to be allowed in ObjectiveC. if I move the label0:; before the try manually, it works. The xsl would need to be changed, so that if there is a jvm:label directly after a jvm:catch, they have to be swapped. I tried but wasn't able to do this myself. Don't know if it has any side effects, too :/ Markus |