Skip to content

Commit e7139e2

Browse files
committed
Add a layer of boxing as a hack; this code can segfault otherwise.
1 parent 6d39be4 commit e7139e2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/comp/syntax/ext/simplext.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
659659
};
660660

661661
let macro_name: option::t[str] = none;
662-
let clauses: [clause] = ~[];
662+
let clauses: [@clause] = ~[];
663663
for arg: @expr in args {
664664
alt arg.node {
665665
expr_vec(elts, mut, seq_kind) {
@@ -691,8 +691,9 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
691691
"macro name must not be a path");
692692
}
693693
}
694-
clauses += ~[{params: pattern_to_selectors(cx, invoc_arg),
695-
body: elts.(1u)}];
694+
clauses +=
695+
~[@{params: pattern_to_selectors(cx, invoc_arg),
696+
body: elts.(1u)}];
696697
// FIXME: check duplicates (or just simplify
697698
// the macro arg situation)
698699
}
@@ -726,8 +727,8 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
726727
ext: normal(ext)};
727728

728729
fn generic_extension(cx: &ext_ctxt, sp: span, arg: @expr,
729-
body: option::t[str], clauses: [clause]) -> @expr {
730-
for c: clause in clauses {
730+
body: option::t[str], clauses: [@clause]) -> @expr {
731+
for c: @clause in clauses {
731732
alt use_selectors_to_bind(c.params, arg) {
732733
some(bindings) {
733734
ret transcribe(cx, bindings, c.body)

0 commit comments

Comments
 (0)