diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-20 00:06:26 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-09-20 17:16:23 +0800 |
commit | 3b813ed29569dde02b965c97c9fdd60469876f66 (patch) | |
tree | 20a5ea09ab0bc99d48acabb0e567affb6c381ca4 /libsolidity/inlineasm/AsmData.h | |
parent | c0b3e5b0785efd1b601cff470d3e3d4a71b2c283 (diff) | |
download | dexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.tar.gz dexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.tar.zst dexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.zip |
Support multiple assignment in inline assembly
Diffstat (limited to 'libsolidity/inlineasm/AsmData.h')
-rw-r--r-- | libsolidity/inlineasm/AsmData.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmData.h b/libsolidity/inlineasm/AsmData.h index db5840bc..b0dd85ca 100644 --- a/libsolidity/inlineasm/AsmData.h +++ b/libsolidity/inlineasm/AsmData.h @@ -54,7 +54,11 @@ struct Label { SourceLocation location; std::string name; }; struct StackAssignment { SourceLocation location; Identifier variableName; }; /// Assignment ("x := mload(20:u256)", expects push-1-expression on the right hand /// side and requires x to occupy exactly one stack slot. -struct Assignment { SourceLocation location; Identifier variableName; std::shared_ptr<Statement> value; }; +/// +/// Multiple assignment ("x, y := f()"), where the left hand side variables each occupy +/// a single stack slot and expects a single expression on the right hand returning +/// the same amount of items as the number of variables. +struct Assignment { SourceLocation location; std::vector<Identifier> variableNames; std::shared_ptr<Statement> value; }; /// Functional instruction, e.g. "mul(mload(20:u256), add(2:u256, x))" struct FunctionalInstruction { SourceLocation location; Instruction instruction; std::vector<Statement> arguments; }; struct FunctionCall { SourceLocation location; Identifier functionName; std::vector<Statement> arguments; }; |