shitty boehm is dereferencing 0x20 for some stupid reason

This commit is contained in:
William Bell
2025-09-02 05:06:48 +01:00
parent f5ee0f6fc8
commit 67569bffc2
9 changed files with 33 additions and 34 deletions

View File

@@ -10,8 +10,9 @@
#include "../translator/translator.h"
#include "internals/dynamic_array_armem/darray_armem.h"
#include "internals/hashmap/hashmap.h"
#include <stdio.h>
#define likely(x) __builtin_expect(!!(x), 1)
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
extern ArgonObject *ARGON_METHOD_TYPE;
@@ -57,8 +58,6 @@ typedef struct StackFrame {
uint64_t depth;
} StackFrame;
#define STACKFRAME_CHUNKS 64
void bootstrap_types();
extern struct hashmap *runtime_hash_table;
@@ -68,22 +67,23 @@ uint64_t runtime_hash(const void *data, size_t len, uint64_t prehash);
void bootstrap_globals();
static inline void *arena_get(ConstantArena *arena, size_t offset) {
return (char*)arena->data + offset;
return (char *)arena->data + offset;
}
static inline uint8_t pop_byte(Translated *translated, RuntimeState *state) {
return ((uint8_t *)(translated->bytecode.data))[state->head++];
return *(((uint8_t *)(translated->bytecode.data)) + state->head++);
}
static inline uint64_t pop_bytecode(Translated *translated, RuntimeState *state) {
uint64_t *ptr = (uint64_t *)((uint8_t*)translated->bytecode.data + state->head);
uint64_t value = *ptr;
state->head += 8;
return value;
static inline uint64_t pop_bytecode(Translated *translated,
RuntimeState *state) {
uint64_t *ptr =
(uint64_t *)((uint8_t *)translated->bytecode.data + state->head);
state->head += 8;
return *ptr;
}
static inline void run_instruction(Translated *translated, RuntimeState *state,
struct Stack **stack, ArErr*err);
struct Stack **stack, ArErr *err);
RuntimeState init_runtime_state(Translated translated, char *path);