forked from checkedc/checkedc-clang
-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
The following two files:
file1.c:
typedef long unsigned int size_t;
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
__attribute__ ((__nothrow__ )) __attribute__ ((__nonnull__ (2))) ;
and file2.c:
typedef long unsigned int size_t;
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ )) __attribute__ ((__nonnull__ (2)));
cause the following crash, only when file1 comes before file2:
0 cconv-standalone 0x0000000104266bca llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 58
1 cconv-standalone 0x0000000104267139 PrintStackTraceSignalHandler(void*) + 25
2 cconv-standalone 0x000000010426503b llvm::sys::RunSignalHandlers() + 123
3 cconv-standalone 0x000000010426b18f SignalHandler(int) + 207
4 libsystem_platform.dylib 0x00007fff6d4e65fd _sigtramp + 29
5 libsystem_platform.dylib 0x00007fc50cb09a58 _sigtramp + 18446743822980494456
6 cconv-standalone 0x00000001046fe4b8 FunctionVariableConstraint::mergeDeclaration(ConstraintVariable*, ProgramInfo&) + 216
....
Interactive debugging revealed that the issue is in PVC's mergeDeclaration's assumption that the number of atoms match:
PVConstraint *From = dyn_cast<PVConstraint>(FromCV);
std::vector<Atom *> NewVatoms;
CAtoms CFrom = From->getCvars();
CAtoms::iterator I = vars.begin();
CAtoms::iterator J = CFrom.begin();
while (I != vars.end()) {
Atom *IAt = *I;
Atom *JAt = *J; //FAILS HERE
This is likely due to incompatible types (char * vs int)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request