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

Method popTopHandler

include/runtime/stackmgr.h:153–167  ·  view source on GitHub ↗

Pop the top handler on the stack.

Source from the content-addressed store, hash-verified

151
152 /// Pop the top handler on the stack.
153 std::optional<Handler> popTopHandler(uint32_t AssocValSize) noexcept {
154 while (!FrameStack.empty()) {
155 auto &Frame = FrameStack.back();
156 if (!Frame.HandlerStack.empty()) {
157 auto TopHandler = std::move(Frame.HandlerStack.back());
158 Frame.HandlerStack.pop_back();
159 assuming(TopHandler.VPos <= ValueStack.size() - AssocValSize);
160 ValueStack.erase(ValueStack.begin() + TopHandler.VPos,
161 ValueStack.end() - AssocValSize);
162 return TopHandler;
163 }
164 FrameStack.pop_back();
165 }
166 return std::nullopt;
167 }
168
169 /// Unsafe remove inactive handler.
170 void removeInactiveHandler(AST::InstrView::iterator PC) noexcept {

Callers 1

throwExceptionMethod · 0.80

Calls 6

backMethod · 0.80
eraseMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected