diff options
| author | Patrick Walton <[email protected]> | 2011-05-06 18:19:42 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-05-06 18:19:42 -0700 |
| commit | a71fda40b865e23f0d191174f4584298534f2f75 (patch) | |
| tree | df4daa109770376646924c43f1d537e3b5fafbfc /src/comp/back | |
| parent | rustllvm: Add a function to add the standard function passes to a module; cha... (diff) | |
| download | rust-a71fda40b865e23f0d191174f4584298534f2f75.tar.xz rust-a71fda40b865e23f0d191174f4584298534f2f75.zip | |
rustc: Make llvm_err() conform to Postel's law a little better
Diffstat (limited to 'src/comp/back')
| -rw-r--r-- | src/comp/back/Link.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/comp/back/Link.rs b/src/comp/back/Link.rs index 695d3202..89ed0d37 100644 --- a/src/comp/back/Link.rs +++ b/src/comp/back/Link.rs @@ -19,7 +19,12 @@ tag output_type { } fn llvm_err(session.session sess, str msg) { - sess.err(msg + ": " + Str.str_from_cstr(llvm.LLVMRustGetLastError())); + auto buf = llvm.LLVMRustGetLastError(); + if ((buf as uint) == 0u) { + sess.err(msg); + } else { + sess.err(msg + ": " + Str.str_from_cstr(buf)); + } fail; } |