Fixed #10481 (misra.py: Bailing out from checking test.c since there was an internal error: Failed to ...)
This commit is contained in:
parent
5767ba794a
commit
2a64ad8dbb
|
@ -2150,7 +2150,8 @@ class MisraChecker:
|
||||||
self.reportError(token, 10, 2)
|
self.reportError(token, 10, 2)
|
||||||
|
|
||||||
if token.str == '-':
|
if token.str == '-':
|
||||||
if getEssentialType(token.astOperand1).split(' ')[-1] != 'char':
|
e1 = getEssentialType(token.astOperand1)
|
||||||
|
if e1 and e1.split(' ')[-1] != 'char':
|
||||||
self.reportError(token, 10, 2)
|
self.reportError(token, 10, 2)
|
||||||
if not isEssentiallyChar(token.astOperand2) and not isEssentiallySignedOrUnsigned(token.astOperand2):
|
if not isEssentiallyChar(token.astOperand2) and not isEssentiallySignedOrUnsigned(token.astOperand2):
|
||||||
self.reportError(token, 10, 2)
|
self.reportError(token, 10, 2)
|
||||||
|
|
|
@ -677,6 +677,10 @@ static void misra_10_2(void) {
|
||||||
|
|
||||||
res = s16a - 'a'; // 10.2 10.3 10.4
|
res = s16a - 'a'; // 10.2 10.3 10.4
|
||||||
res = '0' + f32a; // 10.2 10.4
|
res = '0' + f32a; // 10.2 10.4
|
||||||
|
|
||||||
|
// 10481 - crash
|
||||||
|
char buf[1] = {'f'};
|
||||||
|
x = buf[0] - '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
static void misra_10_3(uint32_t u32a, uint32_t u32b) {
|
static void misra_10_3(uint32_t u32a, uint32_t u32b) {
|
||||||
|
|
Loading…
Reference in New Issue