MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / loadMutability

Method loadMutability

lib/loader/ast/type.cpp:160–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160Expect<ValMut> Loader::loadMutability(ASTNodeAttr From) {
161 // Read the mutability byte.
162 auto B = FMgr.readByte();
163 if (unlikely(!B)) {
164 return logLoadError(B.error(), FMgr.getLastOffset(), From);
165 }
166
167 // Check the mutability cases.
168 switch (static_cast<ValMut>(*B)) {
169 case ValMut::Const:
170 case ValMut::Var:
171 return static_cast<ValMut>(*B);
172 default:
173 return logLoadError(ErrCode::Value::InvalidMut, FMgr.getLastOffset(), From);
174 }
175}
176
177Expect<void> Loader::loadFieldType(AST::FieldType &FType) {
178 // The error code logging is handled.

Callers

nothing calls this directly

Calls 3

unlikelyFunction · 0.85
readByteMethod · 0.80
getLastOffsetMethod · 0.80

Tested by

no test coverage detected