Tests: Appease sanitizer (#3121).
This commit is contained in:
parent
7f1a9239ab
commit
c3c46967dc
|
|
@ -542,6 +542,7 @@ public: // But for internal use only
|
||||||
|
|
||||||
// Internal: Check magic number
|
// Internal: Check magic number
|
||||||
static void checkMagic(const VerilatedContext* contextp);
|
static void checkMagic(const VerilatedContext* contextp);
|
||||||
|
void selfTestClearMagic() { m_magic = 0x2; }
|
||||||
};
|
};
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,9 @@ int main(int argc, char** argv, char** env) {
|
||||||
// Create contexts
|
// Create contexts
|
||||||
VerilatedContext* contextp{new VerilatedContext};
|
VerilatedContext* contextp{new VerilatedContext};
|
||||||
|
|
||||||
delete contextp; // Test mistake - deleting contextp
|
// Ideally we'd do this, but then address sanitizer blows up
|
||||||
|
// delete contextp; // Test mistake - deleting contextp
|
||||||
|
contextp->selfTestClearMagic();
|
||||||
|
|
||||||
// instantiate verilated design
|
// instantiate verilated design
|
||||||
std::unique_ptr<VM_PREFIX> topp{new VM_PREFIX{contextp, "TOP"}};
|
std::unique_ptr<VM_PREFIX> topp{new VM_PREFIX{contextp, "TOP"}};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue