@@ -695,11 +695,28 @@ bool AsmAnalyzer::validateInstructions(std::string_view _instructionIdentifier,
695
695
if (builtinHandle && defaultEVMDialect.builtin (*builtinHandle).instruction .has_value ())
696
696
return validateInstructions (*defaultEVMDialect.builtin (*builtinHandle).instruction , _location);
697
697
698
+ solAssert (!m_eofVersion.has_value () || (*m_eofVersion == 1 && m_evmVersion == langutil::EVMVersion::prague ()));
698
699
// TODO: Change `prague()` to `EVMVersion{}` once EOF gets deployed
699
700
auto const & eofDialect = EVMDialect::strictAssemblyForEVM (EVMVersion::prague (), 1 );
700
701
auto const eofBuiltinHandle = eofDialect.findBuiltin (_instructionIdentifier);
701
- if (eofBuiltinHandle && eofDialect.builtin (*eofBuiltinHandle).instruction .has_value ())
702
- return validateInstructions (*eofDialect.builtin (*eofBuiltinHandle).instruction , _location);
702
+ if (eofBuiltinHandle)
703
+ {
704
+ auto const builtin = eofDialect.builtin (*eofBuiltinHandle);
705
+ if (builtin.instruction .has_value ())
706
+ return validateInstructions (*builtin.instruction , _location);
707
+ else if (!m_eofVersion.has_value ())
708
+ {
709
+ m_errorReporter.declarationError (
710
+ 7223_error,
711
+ _location,
712
+ fmt::format (
713
+ " Builtin function \" {}\" is only available in EOF." ,
714
+ fmt::arg (" function" , _instructionIdentifier)
715
+ )
716
+ );
717
+ return true ;
718
+ }
719
+ }
703
720
704
721
return false ;
705
722
}
@@ -716,8 +733,16 @@ bool AsmAnalyzer::validateInstructions(evmasm::Instruction _instr, SourceLocatio
716
733
yulAssert (
717
734
_instr != evmasm::Instruction::JUMP &&
718
735
_instr != evmasm::Instruction::JUMPI &&
719
- _instr != evmasm::Instruction::JUMPDEST,
720
- " " );
736
+ _instr != evmasm::Instruction::JUMPDEST &&
737
+ _instr != evmasm::Instruction::DATALOADN &&
738
+ _instr != evmasm::Instruction::EOFCREATE &&
739
+ _instr != evmasm::Instruction::RETURNCONTRACT &&
740
+ _instr != evmasm::Instruction::RJUMP &&
741
+ _instr != evmasm::Instruction::RJUMPI &&
742
+ _instr != evmasm::Instruction::CALLF &&
743
+ _instr != evmasm::Instruction::JUMPF &&
744
+ _instr != evmasm::Instruction::RETF
745
+ );
721
746
722
747
auto errorForVM = [&](ErrorId _errorId, std::string const & vmKindMessage) {
723
748
m_errorReporter.typeError (
0 commit comments