We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cfef36 commit 4b3a359Copy full SHA for 4b3a359
wrapper.js
@@ -30,6 +30,9 @@ function setupMethods (soljson) {
30
31
var copyToCString = function (str, ptr) {
32
var length = soljson.lengthBytesUTF8(str);
33
+ // This is allocating memory using solc's allocator.
34
+ // Assuming copyToCString is only used in the context of wrapCallback, solc will free these pointers.
35
+ // See https://github.com/ethereum/solidity/blob/v0.5.13/libsolc/libsolc.h#L37-L40
36
var buffer = soljson._malloc(length + 1);
37
soljson.stringToUTF8(str, buffer, length + 1);
38
soljson.setValue(ptr, buffer, '*');
0 commit comments