Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#14628 fix combined output --asm and asm-json opt #14630

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Ekzer
Copy link

@Ekzer Ekzer commented Oct 21, 2023

Tiny change.
We were only accepting either asm output or asm-json. However, we could be able to chain options and generate both output.
Example :

echo 'contract C {}' | solc - --asm --asm-json

--> <stdin>


======= <stdin>:C =======
EVM assembly:
    /* "<stdin>":0:13  contract C {} */
  mstore(0x40, 0x80)
  callvalue
  dup1
  iszero
  tag_1
  jumpi
  0x00
  dup1
  revert
tag_1:
  pop
  dataSize(sub_0)
  dup1
  dataOffset(sub_0)
  0x00
  codecopy
  0x00
  return
stop

sub_0: assembly {
        /* "<stdin>":0:13  contract C {} */
      mstore(0x40, 0x80)
      0x00
      dup1
      revert

    auxdata: 0xa2646970667358221220369f1c0adbfce56ae85ac3eac2be7e8a65b61677d90975b5d15fe0b7973ebf1764736f6c63782d302e382e32322d646576656c6f702e323032332e31302e32312b636f6d6d69742e64646230643839352e6d6f64005e
}

{".code":[{"begin":0,"end":13,"name":"PUSH","source":0,"value":"80"},{"begin":0,"end":13,"name":"PUSH","source":0,"value":"40"},{"begin":0,"end":13,"name":"MSTORE","source":0},{"begin":0,"end":13,"name":"CALLVALUE","source":0},{"begin":0,"end":13,"name":"DUP1","source":0},{"begin":0,"end":13,"name":"ISZERO","source":0},{"begin":0,"end":13,"name":"PUSH [tag]","source":0,"value":"1"},{"begin":0,"end":13,"name":"JUMPI","source":0},{"begin":0,"end":13,"name":"PUSH","source":0,"value":"0"},{"begin":0,"end":13,"name":"DUP1","source":0},{"begin":0,"end":13,"name":"REVERT","source":0},{"begin":0,"end":13,"name":"tag","source":0,"value":"1"},{"begin":0,"end":13,"name":"JUMPDEST","source":0},{"begin":0,"end":13,"name":"POP","source":0},{"begin":0,"end":13,"name":"PUSH #[$]","source":0,"value":"0000000000000000000000000000000000000000000000000000000000000000"},{"begin":0,"end":13,"name":"DUP1","source":0},{"begin":0,"end":13,"name":"PUSH [$]","source":0,"value":"0000000000000000000000000000000000000000000000000000000000000000"},{"begin":0,"end":13,"name":"PUSH","source":0,"value":"0"},{"begin":0,"end":13,"name":"CODECOPY","source":0},{"begin":0,"end":13,"name":"PUSH","source":0,"value":"0"},{"begin":0,"end":13,"name":"RETURN","source":0}],".data":{"0":{".auxdata":"a2646970667358221220369f1c0adbfce56ae85ac3eac2be7e8a65b61677d90975b5d15fe0b7973ebf1764736f6c63782d302e382e32322d646576656c6f702e323032332e31302e32312b636f6d6d69742e64646230643839352e6d6f64005e",".code":[{"begin":0,"end":13,"name":"PUSH","source":0,"value":"80"},{"begin":0,"end":13,"name":"PUSH","source":0,"value":"40"},{"begin":0,"end":13,"name":"MSTORE","source":0},{"begin":0,"end":13,"name":"PUSH","source":0,"value":"0"},{"begin":0,"end":13,"name":"DUP1","source":0},{"begin":0,"end":13,"name":"REVERT","source":0}]}},"sourceList":["<stdin>","#utility.yul"]}

@github-actions
Copy link

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant