[llvm-commits] CVS: llvm/tools/lli/lli.cpp
Chris Lattner
sabre at nondot.org
Fri Apr 27 10:02:51 PDT 2007
Changes in directory llvm/tools/lli:
lli.cpp updated: 1.69 -> 1.70
---
Log message:
reset errno to zero on entry to the application's main function. This fixes
MultiSource/Applications/minisat in the JIT.
Note that the libsystem stuff should ideally never modify errno. :(
---
Diffs of the changes: (+5 -1)
lli.cpp | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)
Index: llvm/tools/lli/lli.cpp
diff -u llvm/tools/lli/lli.cpp:1.69 llvm/tools/lli/lli.cpp:1.70
--- llvm/tools/lli/lli.cpp:1.69 Mon Mar 5 21:12:55 2007
+++ llvm/tools/lli/lli.cpp Fri Apr 27 12:02:33 2007
@@ -28,7 +28,7 @@
#include "llvm/System/Process.h"
#include "llvm/System/Signals.h"
#include <iostream>
-
+#include <cerrno>
using namespace llvm;
namespace {
@@ -128,6 +128,10 @@
// function later on to make an explicit call, so get the function now.
Constant *Exit = Mod->getOrInsertFunction("exit", Type::VoidTy,
Type::Int32Ty, NULL);
+
+ // Reset errno to zero on entry to main.
+ errno = 0;
+
// Run static constructors.
EE->runStaticConstructorsDestructors(false);
More information about the llvm-commits
mailing list