summaryrefslogtreecommitdiff
path: root/src/binaryen-c.cpp
diff options
context:
space:
mode:
authorIngvar Stepanyan <rreverser@google.com>2019-11-26 17:37:59 +0000
committerAlon Zakai <azakai@google.com>2019-11-26 09:37:59 -0800
commit0215a392ce9f4c5d11305191e27c2e5a2bfd6d7f (patch)
treeab25368835e26e0b6a20d43d3aadaedd2555ac35 /src/binaryen-c.cpp
parent6e23f8e5f4d28eb2056d0b3636b8317b9f299bfc (diff)
downloadbinaryen-0215a392ce9f4c5d11305191e27c2e5a2bfd6d7f.tar.gz
binaryen-0215a392ce9f4c5d11305191e27c2e5a2bfd6d7f.tar.bz2
binaryen-0215a392ce9f4c5d11305191e27c2e5a2bfd6d7f.zip
Use opaque types for handle references in C API (#2473)
This improves typechecking by verifying that user passes pointers of correct types.
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r--src/binaryen-c.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 509e9b569..23472634f 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -4088,7 +4088,7 @@ const char* BinaryenModuleGetDebugInfoFileName(BinaryenModuleRef module,
const char* BinaryenFunctionTypeGetName(BinaryenFunctionTypeRef ftype) {
if (tracing) {
std::cout << " BinaryenFunctionTypeGetName(functionsTypes["
- << functions[ftype] << "]);\n";
+ << functionTypes[ftype] << "]);\n";
}
return ((FunctionType*)ftype)->name.c_str();
@@ -4096,7 +4096,7 @@ const char* BinaryenFunctionTypeGetName(BinaryenFunctionTypeRef ftype) {
BinaryenIndex BinaryenFunctionTypeGetNumParams(BinaryenFunctionTypeRef ftype) {
if (tracing) {
std::cout << " BinaryenFunctionTypeGetNumParams(functionsTypes["
- << functions[ftype] << "]);\n";
+ << functionTypes[ftype] << "]);\n";
}
return ((FunctionType*)ftype)->params.size();
@@ -4105,7 +4105,7 @@ BinaryenType BinaryenFunctionTypeGetParam(BinaryenFunctionTypeRef ftype,
BinaryenIndex index) {
if (tracing) {
std::cout << " BinaryenFunctionTypeGetParam(functionsTypes["
- << functions[ftype] << "], " << index << ");\n";
+ << functionTypes[ftype] << "], " << index << ");\n";
}
auto* ft = (FunctionType*)ftype;
@@ -4115,7 +4115,7 @@ BinaryenType BinaryenFunctionTypeGetParam(BinaryenFunctionTypeRef ftype,
BinaryenType BinaryenFunctionTypeGetResult(BinaryenFunctionTypeRef ftype) {
if (tracing) {
std::cout << " BinaryenFunctionTypeGetResult(functionsTypes["
- << functions[ftype] << "]);\n";
+ << functionTypes[ftype] << "]);\n";
}
return ((FunctionType*)ftype)->result;
@@ -4521,7 +4521,7 @@ RelooperBlockRef RelooperAddBlock(RelooperRef relooper,
}
R->AddBlock(ret);
- return RelooperRef(ret);
+ return RelooperBlockRef(ret);
}
void RelooperAddBranch(RelooperBlockRef from,
@@ -4554,7 +4554,7 @@ RelooperBlockRef RelooperAddBlockWithSwitch(RelooperRef relooper,
}
R->AddBlock(ret);
- return RelooperRef(ret);
+ return RelooperBlockRef(ret);
}
void RelooperAddBranchForSwitch(RelooperBlockRef from,