Coverage Report

Created: 2025-12-31 06:34

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/WasmEdge/lib/loader/ast/expression.cpp
Line
Count
Source
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: 2019-2024 Second State INC
3
4
#include "loader/loader.h"
5
6
namespace WasmEdge {
7
namespace Loader {
8
9
// Load to construct Expression node. See "include/loader/loader.h".
10
Expect<void> Loader::loadExpression(AST::Expression &Expr,
11
38.3k
                                    std::optional<uint64_t> SizeBound) {
12
38.3k
  return loadInstrSeq(SizeBound)
13
38.3k
      .map_error([](auto E) {
14
        // For the section size mismatch case, check in caller.
15
3.48k
        spdlog::error(ErrInfo::InfoAST(ASTNodeAttr::Expression));
16
3.48k
        return E;
17
3.48k
      })
18
38.3k
      .and_then([&](auto Instrs) {
19
34.8k
        Expr.getInstrs() = Instrs;
20
34.8k
        return Expect<void>{};
21
34.8k
      });
22
38.3k
}
23
24
} // namespace Loader
25
} // namespace WasmEdge