Skip to content

Commit

Permalink
Fix extension pointers in cnex
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlarryf committed Apr 11, 2024
1 parent a041415 commit 2e6b024
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion exec/cnex/exclude.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ gc3.neon # Object Count
gc-two-pointers.neon # garbage collection
math-test.neon # math.powmod()

extsample-test.neon # cell_set_pointer
http-test.neon # string$split
sodium-test.neon # binary$shiftRight32() exception
zeromq-test.neon # module
8 changes: 4 additions & 4 deletions exec/cnex/extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ void cell_set_bytes(struct Ne_Cell *cell, const unsigned char *value, int size)

void *cell_get_pointer(const struct Ne_Cell *cell)
{
cell_ensureOther((Cell*)cell);
return (void*)((Cell*)cell)->other;
cell_ensureObject((Cell*)cell);
return ((Cell*)((Cell*)cell)->object->ptr)->other;
}

void cell_set_pointer(struct Ne_Cell *cell, void *p)
{
cell_ensureOther((Cell*)cell);
((Cell*)cell)->other = p;
cell_ensureObject((Cell*)cell);
((Cell*)cell)->object->ptr = cell_createOtherCell(p);
}

int cell_get_array_size(const struct Ne_Cell *cell)
Expand Down

0 comments on commit 2e6b024

Please sign in to comment.