about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@gmail>2013-08-14 15:45:38 +0200
committerMichael Woerister <michaelwoerister@gmail>2013-08-16 22:30:42 +0200
commit44557e7a3372556284ea8ee062a258b0d4377b86 (patch)
tree9dd2fdeefbbd2af5fd4e855f704ece5ecded0add
parent5c9d7c2072ef93adf9912643d025e48ac832c3a6 (diff)
downloadrust-44557e7a3372556284ea8ee062a258b0d4377b86.tar.gz
rust-44557e7a3372556284ea8ee062a258b0d4377b86.zip
debuginfo: Fixed crash occuring for parameterless closures.
-rw-r--r--src/librustc/middle/trans/base.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index 84b3ab20407..1b899093a67 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -1859,6 +1859,10 @@ pub fn trans_closure(ccx: @mut CrateContext,
         set_fixed_stack_segment(fcx.llfn);
     }
 
+    if ccx.sess.opts.debuginfo && fcx_has_nonzero_span(fcx) {
+        debuginfo::create_function_metadata(fcx);
+    }
+
     // Create the first basic block in the function and keep a handle on it to
     //  pass to finish_fn later.
     let bcx_top = fcx.entry_bcx.unwrap();
@@ -1929,12 +1933,7 @@ pub fn trans_fn(ccx: @mut CrateContext,
                   id,
                   attrs,
                   output_type,
-                  |fcx| {
-                      if ccx.sess.opts.debuginfo
-                          && fcx_has_nonzero_span(fcx) {
-                          debuginfo::create_function_metadata(fcx);
-                      }
-                  });
+                  |_fcx| { });
 }
 
 fn insert_synthetic_type_entries(bcx: @mut Block,