mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10133 from ethereum/asm-error-codes
Split error codes for EVM opcodes
This commit is contained in:
commit
fb40f29594
@ -635,19 +635,18 @@ bool AsmAnalyzer::validateInstructions(evmasm::Instruction _instr, SourceLocatio
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((
|
if (_instr == evmasm::Instruction::RETURNDATACOPY && !m_evmVersion.supportsReturndata())
|
||||||
_instr == evmasm::Instruction::RETURNDATACOPY ||
|
|
||||||
_instr == evmasm::Instruction::RETURNDATASIZE
|
|
||||||
) && !m_evmVersion.supportsReturndata())
|
|
||||||
errorForVM(7756_error, "only available for Byzantium-compatible");
|
errorForVM(7756_error, "only available for Byzantium-compatible");
|
||||||
|
else if (_instr == evmasm::Instruction::RETURNDATASIZE && !m_evmVersion.supportsReturndata())
|
||||||
|
errorForVM(4778_error, "only available for Byzantium-compatible");
|
||||||
else if (_instr == evmasm::Instruction::STATICCALL && !m_evmVersion.hasStaticCall())
|
else if (_instr == evmasm::Instruction::STATICCALL && !m_evmVersion.hasStaticCall())
|
||||||
errorForVM(1503_error, "only available for Byzantium-compatible");
|
errorForVM(1503_error, "only available for Byzantium-compatible");
|
||||||
else if ((
|
else if (_instr == evmasm::Instruction::SHL && !m_evmVersion.hasBitwiseShifting())
|
||||||
_instr == evmasm::Instruction::SHL ||
|
|
||||||
_instr == evmasm::Instruction::SHR ||
|
|
||||||
_instr == evmasm::Instruction::SAR
|
|
||||||
) && !m_evmVersion.hasBitwiseShifting())
|
|
||||||
errorForVM(6612_error, "only available for Constantinople-compatible");
|
errorForVM(6612_error, "only available for Constantinople-compatible");
|
||||||
|
else if (_instr == evmasm::Instruction::SHR && !m_evmVersion.hasBitwiseShifting())
|
||||||
|
errorForVM(7458_error, "only available for Constantinople-compatible");
|
||||||
|
else if (_instr == evmasm::Instruction::SAR && !m_evmVersion.hasBitwiseShifting())
|
||||||
|
errorForVM(2054_error, "only available for Constantinople-compatible");
|
||||||
else if (_instr == evmasm::Instruction::CREATE2 && !m_evmVersion.hasCreate2())
|
else if (_instr == evmasm::Instruction::CREATE2 && !m_evmVersion.hasCreate2())
|
||||||
errorForVM(6166_error, "only available for Constantinople-compatible");
|
errorForVM(6166_error, "only available for Constantinople-compatible");
|
||||||
else if (_instr == evmasm::Instruction::EXTCODEHASH && !m_evmVersion.hasExtCodeHash())
|
else if (_instr == evmasm::Instruction::EXTCODEHASH && !m_evmVersion.hasExtCodeHash())
|
||||||
|
@ -14,7 +14,7 @@ contract C {
|
|||||||
// ====
|
// ====
|
||||||
// EVMVersion: =homestead
|
// EVMVersion: =homestead
|
||||||
// ----
|
// ----
|
||||||
// TypeError 7756: (86-100): The "returndatasize" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
// TypeError 4778: (86-100): The "returndatasize" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
||||||
// DeclarationError 3812: (77-102): Variable count mismatch: 1 variables and 0 values.
|
// DeclarationError 3812: (77-102): Variable count mismatch: 1 variables and 0 values.
|
||||||
// TypeError 7756: (115-129): The "returndatacopy" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
// TypeError 7756: (115-129): The "returndatacopy" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
||||||
// TypeError 1503: (245-255): The "staticcall" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
// TypeError 1503: (245-255): The "staticcall" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
||||||
|
@ -17,9 +17,9 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// TypeError 6612: (103-106): The "shl" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 6612: (103-106): The "shl" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (96-116): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (96-116): Variable count does not match number of values (1 vs. 0)
|
||||||
// TypeError 6612: (136-139): The "shr" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 7458: (136-139): The "shr" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (129-147): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (129-147): Variable count does not match number of values (1 vs. 0)
|
||||||
// TypeError 6612: (167-170): The "sar" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 2054: (167-170): The "sar" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (160-178): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (160-178): Variable count does not match number of values (1 vs. 0)
|
||||||
// TypeError 6166: (283-290): The "create2" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 6166: (283-290): The "create2" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (276-302): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (276-302): Variable count does not match number of values (1 vs. 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user