diff --git a/rir/src/compiler/pir/promise.h b/rir/src/compiler/pir/promise.h index 933024100..52bfb70d4 100644 --- a/rir/src/compiler/pir/promise.h +++ b/rir/src/compiler/pir/promise.h @@ -22,7 +22,7 @@ class Promise : public Code { void printName(std::ostream& out) const override; - bool isPromise() const override { return true; } + bool isPromise() const override final { return true; } private: rir::Code* rirSrc_; diff --git a/rir/src/compiler/rir2pir/rir2pir.cpp b/rir/src/compiler/rir2pir/rir2pir.cpp index e98da7ca8..934165e10 100644 --- a/rir/src/compiler/rir2pir/rir2pir.cpp +++ b/rir/src/compiler/rir2pir/rir2pir.cpp @@ -1312,7 +1312,7 @@ bool Rir2Pir::compileBC(const BC& bc, Opcode* pos, Opcode* nextPos, } return true; -} // namespace pir +} bool Rir2Pir::tryCompileContinuation(Builder& insert, Opcode* start, const std::vector& initialStack) { @@ -1586,13 +1586,14 @@ Value* Rir2Pir::tryTranslate(rir::Code* srcCode, Builder& insert, Opcode* start, // stvar { auto n = pc; - for (int i = 0; i < 2 && n < end; ++i, n = BC::next(n)) - ; - if (n < end) { + for (int i = 0; i < 2 && n < end; ++i, n = BC::next(n)) { auto nextbc = BC::decodeShallow(n); - if (nextbc.bc == Opcode::stvar_) + if (nextbc.bc == Opcode::stvar_ || + nextbc.bc == Opcode::stvar_cached_) { inner << ">" << CHAR(PRINTNAME(nextbc.immediateConst())); + break; + } } } inner << "@";