Skip to content

Commit 9d404ba

Browse files
committed
fixup! src: use struct as arguments to node::Assert
1 parent b60184f commit 9d404ba

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/node_errors.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ void AppendExceptionLine(Environment* env,
171171
GetHumanReadableProcessName(&name);
172172

173173
fprintf(stderr,
174-
"%s: %s:%u:%s%s Assertion `%s' failed.\n",
174+
"%s: %s:%s%s Assertion `%s' failed.\n",
175175
name,
176-
info.filename,
177-
info.linenum,
176+
info.file_line,
178177
info.function,
179178
*info.function ? ":" : "",
180179
info.message);

src/util.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ void LowMemoryNotification();
8888
// The reason that Assert() takes a struct argument instead of individual
8989
// const char*s is to ease instruction cache pressure in calls from CHECK.
9090
struct AssertionInfo {
91-
const char* filename;
92-
unsigned int linenum;
91+
const char* file_line; // filename:line
9392
const char* message;
9493
const char* function;
9594
};
@@ -129,7 +128,7 @@ void DumpBacktrace(FILE* fp);
129128
/* Make sure that this struct does not end up in inline code, but */ \
130129
/* rather in a read-only data section when modifying this code. */ \
131130
static const node::AssertionInfo args = { \
132-
__FILE__, __LINE__, #expr, PRETTY_FUNCTION_NAME \
131+
__FILE__ ":" STRINGIFY(__LINE__), #expr, PRETTY_FUNCTION_NAME \
133132
}; \
134133
node::Assert(args); \
135134
} \

0 commit comments

Comments
 (0)