diff --git a/src/V3Number.cpp b/src/V3Number.cpp index 1e1360f33..2c6491845 100644 --- a/src/V3Number.cpp +++ b/src/V3Number.cpp @@ -74,6 +74,12 @@ void V3Number::v3errorEnd(std::ostringstream& str) const { } } +void V3Number::v3errorEndFatal(std::ostringstream& str) const { + v3errorEnd(str); + assert(0); + VL_UNREACHABLE +} + //====================================================================== // Read class functions // CREATION diff --git a/src/V3Number.h b/src/V3Number.h index 363868a9a..432fe8af4 100644 --- a/src/V3Number.h +++ b/src/V3Number.h @@ -204,6 +204,7 @@ private: public: void v3errorEnd(std::ostringstream& sstr) const; + void v3errorEndFatal(std::ostringstream& sstr) const VL_ATTR_NORETURN; void width(int width, bool sized = true) { // Set width. Only set m_width here, as we need to tweak vector size if (width) { diff --git a/test_regress/t/t_dynarray_bad.out b/test_regress/t/t_dynarray_bad.out index 7bb4e86b5..ad5729bd3 100644 --- a/test_regress/t/t_dynarray_bad.out +++ b/test_regress/t/t_dynarray_bad.out @@ -3,4 +3,6 @@ 15 | a = new [s]; | ^~~ ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message. -%Error: Internal Error: ../V3Number.cpp:#: Number operation called with non-logic (double or string) argument: '"str"" +%Error: Internal Error: t/t_dynarray_bad.v:15:16: ../V3Number.cpp:#: Number operation called with non-logic (double or string) argument: '"str"" + 15 | a = new [s]; + | ^ diff --git a/test_regress/t/t_select_bad_tri.out b/test_regress/t/t_select_bad_tri.out index 9405b76e2..2fd802546 100644 --- a/test_regress/t/t_select_bad_tri.out +++ b/test_regress/t/t_select_bad_tri.out @@ -1,4 +1,7 @@ %Error: t/t_select_bad_tri.v:11:24: Selection index is constantly unknown or tristated: 1'bx 11 | if (in[( (1'h0 / 1'b0) )+:71] != 71'h0) $stop; | ^ -%Error: Internal Error: ../V3Number.cpp:#: toUInt with 4-state 1'bx +%Error: Internal Error: t/t_select_bad_tri.v:11:24: ../V3Number.cpp:#: toUInt with 4-state 1'bx + : ... In instance t + 11 | if (in[( (1'h0 / 1'b0) )+:71] != 71'h0) $stop; + | ^