summaryrefslogtreecommitdiff
path: root/src/backend/utils/error/assert.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-10-10 15:16:56 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-10-10 15:16:56 -0400
commit235eb4db9879397acb57a5dfd25c18291052068a (patch)
treec9a6a0d1f2d6c1227079964621f7ae9873a563c1 /src/backend/utils/error/assert.c
parent6291b2546ce729aa912fd070628c6b9eb1f84947 (diff)
Simplify our Assert infrastructure a little.
Remove the Trap and TrapMacro macros, which were nearly unused and confusingly had the opposite condition polarity from the otherwise-functionally-equivalent Assert macros. Having done that, it's very hard to justify carrying the errorType argument of ExceptionalCondition, so drop that too, and just let it assume everything's an Assert. This saves about 64K of code space as of current HEAD. Discussion: https://postgr.es/m/3928703.1665345117@sss.pgh.pa.us
Diffstat (limited to 'src/backend/utils/error/assert.c')
-rw-r--r--src/backend/utils/error/assert.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/utils/error/assert.c b/src/backend/utils/error/assert.c
index 2da512a2f1e..ac6173e660b 100644
--- a/src/backend/utils/error/assert.c
+++ b/src/backend/utils/error/assert.c
@@ -28,20 +28,17 @@
*/
void
ExceptionalCondition(const char *conditionName,
- const char *errorType,
const char *fileName,
int lineNumber)
{
/* Report the failure on stderr (or local equivalent) */
if (!PointerIsValid(conditionName)
- || !PointerIsValid(fileName)
- || !PointerIsValid(errorType))
+ || !PointerIsValid(fileName))
write_stderr("TRAP: ExceptionalCondition: bad arguments in PID %d\n",
(int) getpid());
else
- write_stderr("TRAP: %s(\"%s\", File: \"%s\", Line: %d, PID: %d)\n",
- errorType, conditionName,
- fileName, lineNumber, (int) getpid());
+ write_stderr("TRAP: failed Assert(\"%s\"), File: \"%s\", Line: %d, PID: %d\n",
+ conditionName, fileName, lineNumber, (int) getpid());
/* Usually this shouldn't be needed, but make sure the msg went out */
fflush(stderr);