LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1088 - Module::getOrInsertFunction is unsafe and broken
Summary: Module::getOrInsertFunction is unsafe and broken
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: lli (show other bugs)
Version: 1.0
Hardware: All All
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-07 00:18 PST by Chris Lattner
Modified: 2010-02-22 12:42 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2007-01-07 00:18:36 PST
Consider this program:

#include <stdio.h>
static void exit(int X) {
  printf("myexit called\n");
}
int main() {
  exit(1);
}

This should print 'myexit called' once.  However:

$ llvm-gcc -c -emit-llvm t.c
$ lli t.o
myexit called
myexit called
ERROR: exit(-1073744072) returned!
Abort

This is due to the failures of the Module::getOrInsertFunction method.

-Chris
Comment 1 Chris Lattner 2007-01-07 02:24:24 PST
getOrInsertFunction fixed. lli fixed.