Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ir/possible-contents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ void TNHOracle::infer() {

auto ensureCFG = [&]() {
if (!blockIndexes) {
auto cfg = analysis::CFG::fromFunction(func);
auto cfg = analysis::CFG::fromFunction(func, &wasm);
blockIndexes = analysis::CFGBlockIndexes(cfg);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/passes/TypeGeneralizing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ struct TypeGeneralizing : WalkerPass<PostWalker<TypeGeneralizing>> {
runner.add("dce");
runner.runOnFunction(func);

auto cfg = CFG::fromFunction(func);
auto cfg = CFG::fromFunction(func, wasm);
DBG(cfg.print(std::cerr));
TransferFn txfn(*wasm, func, cfg);
MonotoneCFGAnalyzer analyzer(txfn.lattice, txfn, cfg);
Expand Down
10 changes: 6 additions & 4 deletions src/tools/wasm-fuzz-lattices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,8 @@ struct Fuzzer {
// Helper function to run per-function tests. latticeElementSeed is used to
// generate three lattice elements randomly. It is also used to select which
// analysis is to be tested for the function.
void runOnFunction(Function* func, uint64_t latticeElementSeed) {
void
runOnFunction(Module* wasm, Function* func, uint64_t latticeElementSeed) {
RandEngine getFuncRand(latticeElementSeed);

// Fewer bytes are needed to generate three random lattices.
Expand All @@ -1002,7 +1003,7 @@ struct Fuzzer {
Random rand(std::move(funcBytes));
checkLatticeProperties(rand, verbose);

CFG cfg = CFG::fromFunction(func);
CFG cfg = CFG::fromFunction(func, wasm);

switch (rand.upTo(2)) {
case 0: {
Expand Down Expand Up @@ -1047,13 +1048,14 @@ struct Fuzzer {
// If a specific function and lattice element seed is specified, only run
// that.
if (latticeElementSeed && funcName) {
runOnFunction(testModule.getFunction(*funcName), *latticeElementSeed);
runOnFunction(
&testModule, testModule.getFunction(*funcName), *latticeElementSeed);
return;
}

ModuleUtils::iterDefinedFunctions(testModule, [&](Function* func) {
uint64_t funcSeed = getRand();
runOnFunction(func, funcSeed);
runOnFunction(&testModule, func, funcSeed);
});
}
};
Expand Down
Loading