move assertion into mutex guard, a partial fix for PR1606.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-08-13 20:08:16 +00:00
parent badb2d23d1
commit 17f218e001

View File

@ -238,9 +238,9 @@ GenericValue JIT::runFunction(Function *F,
///
void JIT::runJITOnFunction(Function *F) {
static bool isAlreadyCodeGenerating = false;
assert(!isAlreadyCodeGenerating && "Error: Recursive compilation detected!");
MutexGuard locked(lock);
assert(!isAlreadyCodeGenerating && "Error: Recursive compilation detected!");
// JIT the function
isAlreadyCodeGenerating = true;