This commit is contained in:
anon 2024-07-16 14:33:23 +02:00
parent 59da44580a
commit 3173bc21a1
3 changed files with 8 additions and 3 deletions

View File

@ -55,6 +55,7 @@ void debug_token_dump(void) {
# define debug_puts(msg) # define debug_puts(msg)
# define debug_printf(...) # define debug_printf(...)
# define debug_dump_variables() do {} while (0) # define debug_dump_variables() do {} while (0)
# define debug_token_dump() do {} while (0)
#endif #endif

View File

@ -158,7 +158,6 @@ void free_variable(void * data) {
} }
int eaxhla_destroy(void) { int eaxhla_destroy(void) {
debug_dump_variables();
tommy_hashtable_foreach(&variable_table, free_variable); tommy_hashtable_foreach(&variable_table, free_variable);
tommy_hashtable_done(&variable_table); tommy_hashtable_done(&variable_table);
return 0; return 0;
@ -210,8 +209,11 @@ void dump_variable_to_assembler(void * data) {
if (variable->elements == 1) { if (variable->elements == 1) {
append_instruction_t1(variable->value); append_instruction_t1(variable->value);
} else { } else {
memcpy(t_array + t_count, variable->array_value, variable->elements); for (unsigned long long i = 0; i < variable->elements; i++) {
t_count += variable->elements; debug_printf("'%d'\n", (int)*(char*)(variable->array_value + i));
append_instruction_t1((int)*(char*)(variable->array_value + i));
}
//memcpy(t_array + t_count, variable->array_value, variable->elements);
} }
} }

View File

@ -85,8 +85,10 @@ void dump (const char * file_name) {
fwrite (text_sector_byte, sizeof (* text_sector_byte), fwrite (text_sector_byte, sizeof (* text_sector_byte),
(size_t) text_sector_size, file); (size_t) text_sector_size, file);
/*
// data // data
fwrite ("heyo world!\n", 1UL, 12UL, file); fwrite ("heyo world!\n", 1UL, 12UL, file);
*/
snprintf (meme, 1023UL, "chmod +x %s", file_name); snprintf (meme, 1023UL, "chmod +x %s", file_name);