Skip to content

Commit 2a23bfc

Browse files
committed
Refine basic block allocation for __syscall
1 parent d1a315b commit 2a23bfc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/parser.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5191,13 +5191,14 @@ void parse_internal(void)
51915191
func->return_def.type = TY_int;
51925192
func->num_params = 0;
51935193
func->va_args = 1;
5194-
if (!dynlink) {
5194+
/* In dynlink mode. __syscall won't be implemented but needs to exist
5195+
* for parsing the built-in libc. It will be treated as external.
5196+
*
5197+
* Otherwise, allocate a basic block to implement __syscall in static mode.
5198+
* */
5199+
func->bbs = NULL;
5200+
if (!dynlink)
51955201
func->bbs = arena_calloc(BB_ARENA, 1, sizeof(basic_block_t));
5196-
} else {
5197-
/* In dynlink mode. __syscall won't be implemented but needs to exist
5198-
* for parsing the built-in libc. It will be treated as external */
5199-
func->bbs = NULL;
5200-
}
52015202

52025203
/* lexer initialization */
52035204
SOURCE->size = 0;

0 commit comments

Comments
 (0)