From: Markus H. <ma...@ti...> - 2009-10-16 20:03:29
|
Hi, I have a problem with the synchronized keyword. The generated ObjC- code does not compile. First error is a simple spelling error: http://github.com/tisoft/xmlvm/commit/2d75e56167dd41eee2705dd110895308ac256a80 But fixing that doesn't help since the generated code is still wrong. Just try to convert a simple class like: public class X{ public void test(){ synchronized(this){ } } } This creates some uncompilable stuff in ObjC: - (void) test { XMLVMElem _stack[2]; XMLVMElem _locals[3]; int _sp = 0; XMLVMElem _op1, _op2, _op3; NSAutoreleasePool* _pool = [[NSAutoreleasePool alloc] init]; _locals[0].o = self; label1:; _stack[_sp++].o = _locals[0].o; _op1 = _stack[_sp - 1]; _stack[_sp++] = _op1; _op1.o = _stack[--_sp].o; _locals[1].o = _op1.o; _op1.o = _stack[--_sp].o; @synchronized(_op1.o) { @try { _stack[_sp++].o = _locals[1].o; } } @catch (java_lang_Exception* _ex) { _stack[_sp++].o = _ex; goto label3; } goto label0; @try { label3:; _op1.o = _stack[--_sp].o; _locals[2].o = _op1.o; _stack[_sp++].o = _locals[1].o; } } @catch (java_lang_Exception* _ex) { _stack[_sp++].o = _ex; goto label3; } _stack[_sp++].o = _locals[2].o; _op1.o = _stack[--_sp].o; @throw _op1.o; label0:; [_pool release]; return; } I'm not able to fix it myself, since I don't understand the converting stuff yet, so it would be great if someone of you could look into this. Greetings, Markus |