Skip to content

Fix WASM memory allocation - #1154

Merged
leoyvens merged 1 commit into
masterfrom
leo/hotfix-wasm-memory-allocation
Sep 3, 2019
Merged

Fix WASM memory allocation#1154
leoyvens merged 1 commit into
masterfrom
leo/hotfix-wasm-memory-allocation

Conversation

@leoyvens

@leoyvens leoyvens commented Sep 3, 2019

Copy link
Copy Markdown
Contributor

#1145 made the assumption that two consecutive memory.allocate calls would allocate contiguous memory. This is of course false if AS allocated any memory for itself between the calls. This would cause memory corruption on handlers that did a lot of things and needed to call memory.allocate more than once in raw_new. This was the case with the Betoken subgraph, I reproduced the error locally and verified that this PR fixes it.

@leoyvens
leoyvens requested a review from Jannis September 3, 2019 13:02
@Jannis

Jannis commented Sep 3, 2019

Copy link
Copy Markdown
Contributor

@leoyvens Can we move that explanation into the commit message?

@leoyvens
leoyvens merged commit 48ba71f into master Sep 3, 2019
@leoyvens
leoyvens deleted the leo/hotfix-wasm-memory-allocation branch September 3, 2019 13:30
@leoyvens

leoyvens commented Sep 3, 2019

Copy link
Copy Markdown
Contributor Author

@Jannis oops. It was originally in the commit message, I lost it somehow and then re-wrote in the PR description. Now it's merged, oh well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants