Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extension pointers in cnex #453

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading