From 37443aef8c22f100dc59e81aff6af5a252f3217d Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Fri, 5 Apr 2019 19:48:54 -0700 Subject: Passive segments (#1976) Adds support for the bulk memory proposal's passive segments. Uses a new (data passive ...) s-expression syntax to mark sections as passive. --- test/example/c-api-relooper-unreachable-if.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/example/c-api-relooper-unreachable-if.cpp') diff --git a/test/example/c-api-relooper-unreachable-if.cpp b/test/example/c-api-relooper-unreachable-if.cpp index cfd802b58..3acc65d56 100644 --- a/test/example/c-api-relooper-unreachable-if.cpp +++ b/test/example/c-api-relooper-unreachable-if.cpp @@ -14,9 +14,10 @@ int main() { BinaryenModuleAutoDrop(the_module); { const char* segments[] = { 0 }; + int8_t segmentPassive[] = { 0 }; BinaryenExpressionRef segmentOffsets[] = { 0 }; BinaryenIndex segmentSizes[] = { 0 }; - BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentOffsets, segmentSizes, 0, 0); + BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0); } the_relooper = RelooperCreate(the_module); expressions[1] = BinaryenGetLocal(the_module, 0, 1); @@ -346,8 +347,9 @@ int main() { { const char* segments[] = { 0 }; BinaryenExpressionRef segmentOffsets[] = { 0 }; + int8_t segmentPassive[] = { 0 }; BinaryenIndex segmentSizes[] = { 0 }; - BinaryenSetMemory(the_module, 1, 1, NULL, segments, segmentOffsets, segmentSizes, 0, 0); + BinaryenSetMemory(the_module, 1, 1, NULL, segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0); } expressions[157] = BinaryenConst(the_module, BinaryenLiteralInt32(65535)); expressions[158] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); @@ -554,4 +556,3 @@ int main() { functions.clear(); relooperBlocks.clear(); } - -- cgit v1.2.3