Skip to content

Commit

Permalink
vm: fix another unaligned pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
LBCrion committed Dec 11, 2024
1 parent 171652a commit ce7de2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vm/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static gboolean vm_function ( vm_t *vm )

if(np>vm->stack->len)
return FALSE;
memcpy(&name, vm->ip+2, sizeof(gchar *));
memcpy(&name, vm->ip+2, sizeof(gpointer));
result = value_na;
if( (func = vm_func_lookup(name)) )
{
Expand Down Expand Up @@ -199,8 +199,9 @@ static gboolean vm_function ( vm_t *vm )
static void vm_variable ( vm_t *vm )
{
value_t value;
gchar *name = *((gchar **)(vm->ip+1));
gchar *name;

memcpy(&name, vm->ip+1, sizeof(gpointer));
value = scanner_get_value(name, !vm->use_cached, vm->expr);
expr_dep_add(name, vm->expr);

Expand Down

0 comments on commit ce7de2e

Please sign in to comment.