Skip to content

Commit

Permalink
Fixed a bug related to --no-math64 and --no-longlong
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Chen committed May 4, 2011
1 parent b71e457 commit 717b1c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion runtime/csmith.h
Expand Up @@ -87,7 +87,7 @@ transparent_crc (uint32_t val, char* vname, int flag)
{
crc32_8bytes(val);
if (flag) {
printf("...checksum after hashing %s : %X\n", vname, crc32_context ^ 0xFFFFFFFFUL);
printf("...checksum after hashing %s : %X\n", vname, crc32_context ^ 0xFFFFFFFFU);
}
}
#else
Expand Down
6 changes: 3 additions & 3 deletions src/OutputMgr.cpp
Expand Up @@ -391,9 +391,9 @@ OutputMgr::OutputHeader(int argc, char *argv[], unsigned long seed)

if (!CGOptions::longlong()) {
out << endl;
out << "#ifndef __x86_64__" << std::endl;
//out << "#ifndef __x86_64__" << std::endl;
out << "#define NO_LONGLONG" << std::endl;
out << "#endif" << std::endl;
//out << "#endif" << std::endl;
out << endl;
}

Expand All @@ -417,7 +417,7 @@ OutputMgr::OutputHeader(int argc, char *argv[], unsigned long seed)
}
out << endl;

out << "long __undefined;" << endl;
out << "int32_t __undefined;" << endl;
out << endl;

if (CGOptions::depth_protect()) {
Expand Down
4 changes: 4 additions & 0 deletions src/Probabilities.cpp
Expand Up @@ -650,6 +650,10 @@ Probabilities::set_default_simple_types_prob()
else {
SET_SINGLE_NAME("long_long_prob", LongLong, 0);
SET_SINGLE_NAME("ulong_long_prob", ULongLong, 0);
if (CGOptions::x86_64()) {
SET_SINGLE_NAME("long_long_prob", Long, 0);
SET_SINGLE_NAME("ulong_long_prob", ULong, 0);
}
}

set_group_prob(true, pSimpleTypesProb, m);
Expand Down
6 changes: 4 additions & 2 deletions src/Type.cpp
Expand Up @@ -1043,9 +1043,11 @@ Type::GenerateSimpleTypes(void)
unsigned int st;
for (st=eChar; st<MAX_SIMPLE_TYPES; st++)
{
#if 0
if ((st==eLongLong || st==eULongLong) && !CGOptions::allow_int64())
continue;
AllTypes.push_back(new Type((enum eSimpleType)st));
continue;
#endif
AllTypes.push_back(new Type((enum eSimpleType)st));
}
Type::void_type = new Type((enum eSimpleType)eVoid);
}
Expand Down

0 comments on commit 717b1c9

Please sign in to comment.