mirror of
https://github.com/verilator/verilator.git
synced 2025-01-21 13:54:06 +00:00
Minor compiler compatibility fixes
- Initialize variable to avoid 'may be uninitialized' warning - More reliable segfault (the previous version was compiled into an undefined instruction by clang sometimes, thew new one is always a store to zero).
This commit is contained in:
parent
f0f68f42d1
commit
b1c7de4ad5
@ -176,7 +176,7 @@ private:
|
|||||||
void prepost_stmt_visit(AstNodeTriop* nodep) {
|
void prepost_stmt_visit(AstNodeTriop* nodep) {
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
|
|
||||||
AstNodeVarRef* varrefp;
|
AstNodeVarRef* varrefp = nullptr;
|
||||||
if (m_unsupportedHere || !(varrefp = VN_CAST(nodep->rhsp(), VarRef))) {
|
if (m_unsupportedHere || !(varrefp = VN_CAST(nodep->rhsp(), VarRef))) {
|
||||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Incrementation in this context.");
|
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Incrementation in this context.");
|
||||||
return;
|
return;
|
||||||
|
@ -815,7 +815,7 @@ string V3Options::protectKeyDefaulted() {
|
|||||||
void V3Options::throwSigsegv() { // LCOV_EXCL_START
|
void V3Options::throwSigsegv() { // LCOV_EXCL_START
|
||||||
#if !(defined(VL_CPPCHECK) || defined(__clang_analyzer__))
|
#if !(defined(VL_CPPCHECK) || defined(__clang_analyzer__))
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ char* zp = nullptr; *zp = 0; } // Intentional core dump, ignore warnings here
|
*static_cast<volatile char*>(nullptr) = 0; // Intentional core dump, ignore warnings here
|
||||||
// clang-format on
|
// clang-format on
|
||||||
#endif
|
#endif
|
||||||
} // LCOV_EXCL_STOP
|
} // LCOV_EXCL_STOP
|
||||||
|
Loading…
Reference in New Issue
Block a user