MCPcopy Create free account
hub / github.com/WebAssembly/wabt / CheckGet

Method CheckGet

src/validator.cc:1050–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1048}
1049
1050Result ScriptValidator::CheckGet(const GetAction* action, Type* out_type) {
1051 const Module* module = script_->GetModule(action->module_var);
1052 if (!module) {
1053 PrintError(&action->loc, "unknown module");
1054 return Result::Error;
1055 }
1056
1057 const Export* export_ = module->GetExport(action->name);
1058 if (!export_) {
1059 PrintError(&action->loc, "unknown global export \"%s\"",
1060 action->name.c_str());
1061 return Result::Error;
1062 }
1063
1064 const Global* global = module->GetGlobal(export_->var);
1065 if (!global) {
1066 // This error will have already been reported, just skip it.
1067 return Result::Error;
1068 }
1069
1070 *out_type = global->type;
1071 return Result::Ok;
1072}
1073
1074ScriptValidator::ActionResult ScriptValidator::CheckAction(
1075 const Action* action) {

Callers

nothing calls this directly

Calls 3

GetModuleMethod · 0.80
GetExportMethod · 0.80
GetGlobalMethod · 0.80

Tested by

no test coverage detected