Skip to content

Commit

Permalink
Add missing space, add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Feb 23, 2024
1 parent a956427 commit 4039baa
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/generators/hlopt.ml
Expand Up @@ -482,7 +482,7 @@ let code_graph (f:fundecl) =
} in
Hashtbl.add blocks_pos pos b;
let rec loop i =
let goto ?(tl=b.btrap) d=
let goto ?(tl=b.btrap) d =
let b2 = make_block tl (i + 1 + d) in
b2.bprev <- b :: b2.bprev;
b2
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/src/unit/issues/Issue11466.hx
@@ -0,0 +1,14 @@
package unit.issues;

class Issue11466 extends unit.Test {
var b = 10;
function test() {
var x = 0;
try {
x = b;
throw "hi";
}catch(_) {
eq(b, x);
}
}
}
18 changes: 18 additions & 0 deletions tests/unit/src/unit/issues/Issue9174.hx
@@ -0,0 +1,18 @@
package unit.issues;

class Issue9174 extends unit.Test {
function test() {
var value = false;
try {
try {
throw '';
} catch(e:String) {
value = true;
t(value);
throw e;
}
} catch(e:String) {
t(value);
}
}
}

0 comments on commit 4039baa

Please sign in to comment.