aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-02-01 18:02:57 -0800
committerGraydon Hoare <[email protected]>2011-02-01 18:02:57 -0800
commitf22dc4d581760d365392323a431f4787f31ae130 (patch)
treebf75b70c2cf8ab080c10b7983ea2f7db3f3e1245 /src/comp
parentAdd very minimal support for native modules. For now they must be empty. (diff)
downloadrust-f22dc4d581760d365392323a431f4787f31ae130.tar.xz
rust-f22dc4d581760d365392323a431f4787f31ae130.zip
Fix buggy argument assembly for upcall_get_type_desc. Can now complete calls to glue of derived tydescs.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index c08147fe..c955340e 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -983,14 +983,14 @@ fn get_tydesc(&@block_ctxt cx, @ty.t t) -> result {
auto root = cx.fcx.ccx.tydescs.get(t);
auto tydescs = cx.build.Alloca(T_array(T_ptr(T_tydesc()), n_params));
+
auto i = 0;
+ auto tdp = cx.build.GEP(tydescs, vec(C_int(0), C_int(i)));
+ cx.build.Store(root, tdp);
+ i += 1;
for (ValueRef td in tys._1) {
auto tdp = cx.build.GEP(tydescs, vec(C_int(0), C_int(i)));
- if (i == 0) {
- cx.build.Store(root, tdp);
- } else {
- cx.build.Store(td, tdp);
- }
+ cx.build.Store(td, tdp);
i += 1;
}