mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9039 from ethereum/yul-remove-pc-instr
[Yul] remove PC instruction
This commit is contained in:
commit
1f49edd29d
@ -8,6 +8,7 @@ Breaking changes:
|
|||||||
* Type Checker: Disallow shifts by signed types.
|
* Type Checker: Disallow shifts by signed types.
|
||||||
|
|
||||||
Language Features:
|
Language Features:
|
||||||
|
* Yul: Disallow EVM instruction `pc()`.
|
||||||
|
|
||||||
|
|
||||||
Compiler Features:
|
Compiler Features:
|
||||||
|
@ -580,16 +580,18 @@ bool AsmAnalyzer::warnOnInstructions(evmasm::Instruction _instr, SourceLocation
|
|||||||
errorForVM("only available for Constantinople-compatible");
|
errorForVM("only available for Constantinople-compatible");
|
||||||
else if (_instr == evmasm::Instruction::CHAINID && !m_evmVersion.hasChainID())
|
else if (_instr == evmasm::Instruction::CHAINID && !m_evmVersion.hasChainID())
|
||||||
errorForVM("only available for Istanbul-compatible");
|
errorForVM("only available for Istanbul-compatible");
|
||||||
else if (_instr == evmasm::Instruction::PC)
|
|
||||||
m_errorReporter.warning(
|
|
||||||
2450_error,
|
|
||||||
_location,
|
|
||||||
"The \"" +
|
|
||||||
boost::to_lower_copy(instructionInfo(_instr).name) +
|
|
||||||
"\" instruction is deprecated and will be removed in the next breaking release."
|
|
||||||
);
|
|
||||||
else if (_instr == evmasm::Instruction::SELFBALANCE && !m_evmVersion.hasSelfBalance())
|
else if (_instr == evmasm::Instruction::SELFBALANCE && !m_evmVersion.hasSelfBalance())
|
||||||
errorForVM("only available for Istanbul-compatible");
|
errorForVM("only available for Istanbul-compatible");
|
||||||
|
else if (_instr == evmasm::Instruction::PC)
|
||||||
|
{
|
||||||
|
m_errorReporter.error(
|
||||||
|
4316_error,
|
||||||
|
Error::Type::SyntaxError,
|
||||||
|
_location,
|
||||||
|
"PC instruction is a low-level EVM feature. "
|
||||||
|
"Because of that PC is disallowed in strict assembly."
|
||||||
|
);
|
||||||
|
}
|
||||||
else if (
|
else if (
|
||||||
_instr == evmasm::Instruction::JUMP ||
|
_instr == evmasm::Instruction::JUMP ||
|
||||||
_instr == evmasm::Instruction::JUMPI ||
|
_instr == evmasm::Instruction::JUMPI ||
|
||||||
|
@ -6,4 +6,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// Warning: (61-63): The "pc" instruction is deprecated and will be removed in the next breaking release.
|
// SyntaxError: (61-63): PC instruction is a low-level EVM feature. Because of that PC is disallowed in strict assembly.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evmTyped
|
// dialect: evmTyped
|
||||||
// ----
|
// ----
|
||||||
// Warning: (10-12): The "pc" instruction is deprecated and will be removed in the next breaking release.
|
// SyntaxError: (10-12): PC instruction is a low-level EVM feature. Because of that PC is disallowed in strict assembly.
|
||||||
|
Loading…
Reference in New Issue
Block a user