Skip to content

Commit ab483a6

Browse files
committed
---
yaml --- r: 1119 b: refs/heads/master c: 490da35 h: refs/heads/master i: 1117: 53d33d5 1115: 634f93d 1111: 492ba6a 1103: 86a3aaa 1087: 0ed4ce3 v: v3
1 parent 64270ae commit ab483a6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6a8518c97bd5ef484e8046531c711661ede91d89
2+
refs/heads/master: 490da3564be081eb40a711e83ae05fe07d5c6d2c

trunk/src/comp/middle/trans.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,13 @@ impure fn trans_vtbl(@crate_ctxt cx, &ast._obj ob) -> ValueRef {
23552355
trans_fn(cx, m.node.meth, m.node.id, m.node.ann);
23562356
methods += llfn;
23572357
}
2358-
ret C_struct(methods);
2358+
auto vtbl = C_struct(methods);
2359+
auto gvar = llvm.LLVMAddGlobal(cx.llmod,
2360+
val_ty(vtbl),
2361+
_str.buf("_rust_vtbl" + "." + cx.path));
2362+
llvm.LLVMSetInitializer(gvar, vtbl);
2363+
llvm.LLVMSetGlobalConstant(gvar, True);
2364+
ret gvar;
23592365
}
23602366

23612367
impure fn trans_obj(@crate_ctxt cx, &ast._obj ob, ast.def_id oid,

0 commit comments

Comments
 (0)