[kaffe] kaffeh leaves incomplete output files
   
    Takahiko_Kawasaki@cii.csk.co.jp
     
    Takahiko_Kawasaki@cii.csk.co.jp
       
    Mon, 29 Jul 2002 13:14:59 +0900
    
    
  
The last item of the known-bugs says:
     --------------------------------------
     kaffeh leaves incomplete output files
     around if it bails (fails?) because
     it cannot find the class file.
     --------------------------------------
It seems that this is caused by inappropriate exit()'s
called in the function 'kaffeh_findClass()' in the file
'kaffe/kaffeh/support.c'.
If below modifications are applied, the bug may be fixed.
     1. change kaffeh_findClass()'s prototype so that
        it can return its status.
     2. change all the 'return;'s in kaffeh_findClass()
        into 'return 0;' to indicate it has succeeded.
     3. change all the 'exit()'s in kaffeh_findClass()
        into 'return -1;' to indicate it has failed.
     4. treat the return value of kaffeh_findClass()
        appropriately in 'main()' in the file
        'kaffe/kaffeh/main.c'.  For example, in case
        kaffeh_findClass() returns failure status,
        remove the corresponding output file, or
        insert '#error ......' line before closing
        the file.
As far as I have looked into source codes, kaffeh_findClass()
is called from only main() in kaffe/kaffeh/main.c and
setupClass() in kaffe/kaffeh/support.c.  However, setupClass()
in kaffe/kaffeh/support.c is not called from anywhere (there
is a similar function in kaffe/kaffevm/classMethod.c). So,
I think modifications above can be simply applied.
Takahiko KAWASAKI