cppcheckdata: Fix crash on an empty union (#3326)
This commit is contained in:
parent
7d7241b076
commit
6f389014f1
|
@ -404,7 +404,9 @@ class Scope:
|
|||
self.nestedIn = IdMap[self.nestedInId]
|
||||
self.function = IdMap[self.functionId]
|
||||
for v in self.varlistId:
|
||||
self.varlist.append(IdMap[v])
|
||||
value = IdMap.get(v)
|
||||
if value:
|
||||
self.varlist.append(value)
|
||||
|
||||
|
||||
class Function:
|
||||
|
|
|
@ -41,6 +41,16 @@
|
|||
#include <tgmath.h> // 21.11
|
||||
#include <fenv.h>
|
||||
|
||||
// Check that the addon doesn't crash
|
||||
typedef struct {
|
||||
union { // 19.2
|
||||
struct {
|
||||
unsigned a : 2;
|
||||
unsigned : 14;
|
||||
};
|
||||
uint16_t value;
|
||||
};
|
||||
} STRUCT_BITS;
|
||||
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
|
|
Loading…
Reference in New Issue