GNOME Bugzilla – Bug 562384
broken codegen causes exceptions to be silently suppressed [affects all versions including trunk]
Last modified: 2008-11-30 23:03:45 UTC
Please describe the problem: After 3 days of debugging I finally managed to reduce this weird bug down to a small understandable test case. Basically the Vala code generator sometimes generates code for methods in such a way that exceptions (g_error codes) are suppressed and forgotten. That this is a codegen bug because evident when you look at the generated code for ForwardingMethod(), it looks like this: static gint someclass_ForwardingMethod (GError** error) { GError * inner_error; inner_error = NULL; return someclass_MethodTwentyTwo (&inner_error); } Clearly, whatever is written to inner_error will be ignored and forgotten, instead I think it was intended that it should say &error directly and that the inner_error should never have been declared? Feel free to use this test case as a regression test in the future. Steps to reproduce: 1. download the attached test case 2. execute "make run" Actual: The assert(false) is reached. Expected: Since the method always throws an error, it should be impossible to reach the assert. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 123494 [details] minimal testcase showing codegen causing silently suppressed exception
FWIW, I suspect that this bug might be hiding somewhere between line 1966 and 2044 inside the file vala/valaccodebasemodule.vala
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of 475922 ***
Thank you very much for fixing this bug Jürg. Keep up the good work. Vala rocks!