]> git.lizzy.rs Git - rust.git/commit
rustc: Work around a segmentation fault
authorHaitao Li <lihaitao@gmail.com>
Mon, 12 Dec 2011 13:40:03 +0000 (21:40 +0800)
committerGraydon Hoare <graydon@mozilla.com>
Tue, 13 Dec 2011 00:15:29 +0000 (16:15 -0800)
commit76f13c95a0d1b1f33805719ccde9600b000e4418
treef113a9eed0247722caebf68001a932327a7a4574
parent6c6f83f69312c681731f5fd28137de450b4d2881
rustc: Work around a segmentation fault

On Linux/Mac, I got a segmentation fault:

  (gdb) bt
  #0  0x00000000007519af in glue_take584 ()
  #1  0x00000000006d4bec in
    back::rpath::get_rpath_flags::_3899df2ca513c603 ()
  #2  0x00000000006c7655 in back::link::link_binary::_7afde00a9791031c ()
  #3  0x00000000007d3ff5 in driver::rustc::compile_input::thunk9212 ()
  #4  0x0000000000710f24 in driver::rustc::time::_3e691b2a4ba58aee ()
  #5  0x000000000071a79d in
    driver::rustc::compile_input::_7b4a41b87c18e034 ()
  #6  0x000000000072f0a9 in driver::rustc::main::_cd8b8c8185af3dee ()
  #7  0x000000000072f1ed in _rust_main ()
  #8  0x00007ffff7e6e146 in task_start_wrapper (a=<optimized out>) at
    ../src/rt/rust_task.cpp:176

The variable `output` or `out_filename` becomes (null) after the definition
of `fn unlib`. Move the function defintion to the beginning seems
prevent the crash on Linux.
src/comp/back/link.rs