Added debug messages to initialisation functions, but getting a segfault.

Not going to debug that tonight!
This commit is contained in:
Simon Brooke 2026-04-16 00:22:24 +01:00
parent f751fc8a09
commit 25c87aac6e
4 changed files with 29 additions and 1 deletions

View file

@ -9,6 +9,8 @@
#include <stdbool.h>
#include "debug.h"
#include "memory/memory.h"
#include "memory/node.h"
#include "memory/pointer.h"
@ -39,6 +41,7 @@ struct pso_pointer initialise_environment( uint32_t node ) {
struct pso_pointer result = initialise_memory( node );
if ( !exceptionp( result ) ) {
debug_print( L"Initialising `nil`... ", DEBUG_BOOTSTRAP, 0);
struct pso_pointer n = allocate( NILTAG, 2 );
if ( ( n.page == 0 ) && ( n.offset == 0 ) ) {
@ -47,14 +50,17 @@ struct pso_pointer initialise_environment( uint32_t node ) {
object->payload.cons.cdr = nil;
nil = n;
debug_print( L"success\n", DEBUG_BOOTSTRAP, 0);
} else {
result =
make_exception( c_string_to_lisp_string
( L"Unexpected cell while allocating `nil`." ),
nil, n );
debug_print( L"fail\n", DEBUG_BOOTSTRAP, 0);
}
}
if ( !exceptionp( result ) ) {
debug_print( L"Initialising `t`... ", DEBUG_BOOTSTRAP, 0);
struct pso_pointer n = allocate( TRUETAG, 2 );
if ( ( n.page == 0 ) && ( n.offset == 1 ) ) {
@ -63,11 +69,13 @@ struct pso_pointer initialise_environment( uint32_t node ) {
object->payload.cons.cdr = t;
t = n;
debug_print( L"success\n", DEBUG_BOOTSTRAP, 0);
} else {
result =
make_exception( c_string_to_lisp_string
( L"Unexpected cell while allocating `t`." ),
nil, n );
debug_print( L"fail\n", DEBUG_BOOTSTRAP, 0);
}
}
if ( !exceptionp( result ) ) {