@@ -1267,6 +1267,7 @@ module TexprTransformer = struct
declare_var ctx.graph v;
let scope = increase_scope() in
let bb_catch = create_node BKNormal bb_exc e.etype e.epos in
+ add_var_def g bb_catch v;
add_cfg_edge g bb_exc bb_catch CFGGoto;
let bb_catch_next = block bb_catch e in
scope();
@@ -6,6 +6,22 @@ class Issue4757 extends Test {
eq('ca: 2, cb: 1', cunion(1, 2));
}
+ function test2() {
+ var cb = getInt();
+ var result = "";
+ try {
+ throw 1;
+ } catch (ca:Int) {
+ var tmp = ca;
+ ca = cb;
+ cb = tmp;
+ result = 'ca: $ca, cb: $cb';
+ }
+ eq('ca: 2, cb: 1', result);
+
+ static function getInt() return 2;
static function cunion(ca:Int, cb:Int) {
var tmp = ca;
ca = cb;