qmake/vcxproj: fix parsing of /RTC* options

/RTCsu and /RTCus must be handled as full runtime check options.

Task-number: QTBUG-30711

Change-Id: I783bf49f2ab1d4fd9636dca8e434bccb54844c8c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
bb10
Joerg Bornemann 2013-05-02 18:42:09 +02:00 committed by The Qt Project
parent a3d1d41d1d
commit 3c62f4d0c6
2 changed files with 30 additions and 14 deletions

View File

@ -779,16 +779,14 @@ bool VCCLCompilerTool::parseOption(const char* option)
found = false; break;
case 'R':
if(second == 'T' && third == 'C') {
if(fourth == '1')
BasicRuntimeChecks = runtimeBasicCheckAll;
else if(fourth == 'c')
SmallerTypeCheck = _True;
else if(fourth == 's')
BasicRuntimeChecks = runtimeCheckStackFrame;
else if(fourth == 'u')
BasicRuntimeChecks = runtimeCheckUninitVariables;
else
found = false; break;
int rtc = BasicRuntimeChecks;
for (size_t i = 4; option[i]; ++i) {
if (!parseRuntimeCheckOption(option[i], &rtc)) {
found = false;
break;
}
}
BasicRuntimeChecks = static_cast<basicRuntimeCheckOption>(rtc);
}
break;
case 'T':
@ -1138,6 +1136,21 @@ bool VCCLCompilerTool::parseOption(const char* option)
return true;
}
bool VCCLCompilerTool::parseRuntimeCheckOption(char c, int *rtc)
{
if (c == '1')
*rtc = runtimeBasicCheckAll;
else if (c == 'c')
SmallerTypeCheck = _True;
else if (c == 's')
*rtc |= runtimeCheckStackFrame;
else if (c == 'u')
*rtc |= runtimeCheckUninitVariables;
else
return false;
return true;
}
// VCLinkerTool -----------------------------------------------------
VCLinkerTool::VCLinkerTool()
: DataExecutionPrevention(unset),

View File

@ -106,10 +106,10 @@ enum asmListingOption {
asmListingAsmSrc
};
enum basicRuntimeCheckOption {
runtimeBasicCheckNone,
runtimeCheckStackFrame,
runtimeCheckUninitVariables,
runtimeBasicCheckAll
runtimeBasicCheckNone = 0,
runtimeCheckStackFrame = 1,
runtimeCheckUninitVariables = 2,
runtimeBasicCheckAll = runtimeCheckStackFrame | runtimeCheckUninitVariables
};
enum browseInfoOption {
brInfoNone,
@ -580,6 +580,9 @@ public:
QString PreprocessOutputPath;
VCConfiguration* config;
private:
bool parseRuntimeCheckOption(char c, int *rtc);
};
class VCLinkerTool : public VCToolBase