AsmPrinter: Don't include whitespace after @src if there's no code snippet

This commit is contained in:
Kamil Śliwak 2021-09-17 20:53:32 +02:00
parent d7ddfcc665
commit a9b5835e5d
2 changed files with 7 additions and 7 deletions

View File

@ -293,7 +293,7 @@ string AsmPrinter::formatSourceLocation(
":" + ":" +
to_string(_location.end); to_string(_location.end);
return joinHumanReadable(vector<string>{sourceLocation, solidityCodeSnippet}, " "); return sourceLocation + (solidityCodeSnippet.empty() ? "" : " ") + solidityCodeSnippet;
} }
string AsmPrinter::formatDebugData(shared_ptr<DebugData const> const& _debugData, bool _statement) string AsmPrinter::formatDebugData(shared_ptr<DebugData const> const& _debugData, bool _statement)

View File

@ -599,15 +599,15 @@ object \"C_54\" {
let newFreePtr := add(160, and(add(argSize, 31), not(31))) let newFreePtr := add(160, and(add(argSize, 31), not(31)))
if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, 160)) if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, 160))
{ {
mstore(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ shl(224, 0x4e487b71)) mstore(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ shl(224, 0x4e487b71))
mstore(4, 0x41) mstore(4, 0x41)
revert(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ 0x24) revert(/** @src -1:-1:-1 */ 0, /** @src 0:79:435 \"contract C...\" */ 0x24)
} }
mstore(64, newFreePtr) mstore(64, newFreePtr)
codecopy(160, programSize, argSize) codecopy(160, programSize, argSize)
if slt(argSize, 32) if slt(argSize, 32)
{ {
revert(/** @src -1:-1:-1 */ 0, 0) revert(/** @src -1:-1:-1 */ 0, 0)
} }
/// @src 0:79:435 \"contract C...\" /// @src 0:79:435 \"contract C...\"
constructor_C(mload(160)) constructor_C(mload(160))
@ -1431,15 +1431,15 @@ object \"D_72\" {
let newFreePtr := add(160, and(add(argSize, 31), not(31))) let newFreePtr := add(160, and(add(argSize, 31), not(31)))
if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, 160)) if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, 160))
{ {
mstore(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(224, 0x4e487b71)) mstore(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ shl(224, 0x4e487b71))
mstore(4, 0x41) mstore(4, 0x41)
revert(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ 0x24) revert(/** @src -1:-1:-1 */ 0, /** @src 1:91:166 \"contract D is C(3)...\" */ 0x24)
} }
mstore(64, newFreePtr) mstore(64, newFreePtr)
codecopy(160, programSize, argSize) codecopy(160, programSize, argSize)
if slt(argSize, 32) if slt(argSize, 32)
{ {
revert(/** @src -1:-1:-1 */ 0, 0) revert(/** @src -1:-1:-1 */ 0, 0)
} }
/// @src 1:91:166 \"contract D is C(3)...\" /// @src 1:91:166 \"contract D is C(3)...\"
constructor_D(mload(160)) constructor_D(mload(160))