History

added support for standalone operation

bellard committed 24 years ago

Commit 42642671 parent 59b27e81 file · +8 −2Browse files

Unified · Split

bcheck.c+8−2
@@ -95,10 +95,14 @@ static void *saved_realloc_hook; · 94 unmodified lines
9595 static void *saved_memalign_hook;
9696 #endif
9797
98+/* linker definitions */
9899 extern char _end;
99100
100−/* TCC defines: */
101+/* TCC definitions */
101102 extern char __bounds_start; /* start of static bounds table */
103+/* error function. if NULL, simply do abort() */
104+void (*__bound_error_func)(unsigned long caller, const char *msg);
105+
102106 /* runtime error output */
103107 extern void rt_error(unsigned long pc, const char *fmt, ...);
104108
@@ -141,7 +145,9 @@ static BoundEntry *__bound_find_region(BoundEntry *e1, void *p) · 36 unmodified lines
141145 /* print a bound error message */
142146 static void bound_error(const void *caller, const char *fmt, ...)
143147 {
144− rt_error((unsigned long)caller, "%s", fmt);
148+ if (!__bound_error_func)
149+ abort();
150+ __bound_error_func((unsigned long)caller, fmt);
145151 }
146152
147153 static void bound_alloc_error(void)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t