After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 530212 - rethrowing exceptions from the catch block no longer works
rethrowing exceptions from the catch block no longer works
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.3.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
: 505557 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-04-27 15:01 UTC by Ondrej Jirman
Modified: 2008-05-17 13:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ondrej Jirman 2008-04-27 15:01:20 UTC
Please describe the problem:
Code like this (compiled using the vala from SVN):

  public bool connect() throws GLib.Error
  {
    try 
    {
      throw new ServerError.FATAL("Invalid credentials.");
    } 
    catch (GLib.Error e) 
    {
      throw e;
    }
  }

produces infinite loop, because throw e generates goto __catch3_g_error;

Steps to reproduce:
Try to run the code.

Actual results:
Infinite loop, out of memory condition, my machine locks up and I must wait awful lot of time for e2fsck to complete after reboot. Muhahaha. :)

Expected results:


Does this happen every time?
Yes

Other information:
Comment 1 Jürg Billeter 2008-05-02 19:41:03 UTC
Confirming.
Comment 2 Jürg Billeter 2008-05-02 20:37:09 UTC
2008-05-02  Jürg Billeter  <j@bitron.ch>

	* vala/valacatchclause.vala:
	* gobject/valaccodegenerator.vala:

	Fix error handling in catch and finally clauses, fixes bug 530212

Fixed in r1334.
Comment 3 Jürg Billeter 2008-05-17 13:14:11 UTC
*** Bug 505557 has been marked as a duplicate of this bug. ***