Skip to content

EthDebug source range offsets must be non-negative #15998

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

Open
RaoulSchaffranek opened this issue Apr 11, 2025 · 0 comments · May be fixed by #15994
Open

EthDebug source range offsets must be non-negative #15998

RaoulSchaffranek opened this issue Apr 11, 2025 · 0 comments · May be fixed by #15994
Labels

Comments

@RaoulSchaffranek
Copy link

Description

According to the EthDebug JSON schema, source range offsets must be non-negative integers, see: https://ethdebug.github.io/format/spec/materials/source-range

However, solc sets it to -1 in some cases.

Environment

  • Compiler version: Version: 0.8.29+commit.ab55807c.Linux.g++
  • Compilation pipeline (legacy, IR, EOF): IR
  • Target EVM version (as per compiler settings): osaka
  • Framework/IDE (e.g. Foundry, Hardhat, Remix): no
  • EVM execution environment / backend / blockchain client: not applicable
  • Operating system: WSL

Steps to Reproduce

solc --standard-json test/cmdlineTests/standard_output_debuginfo_ethdebug_compatible/input.json > output.json

See, https://github.com/ethereum/solidity/blob/4f23c18e7c7668abffabaaa5095107015e500714/test/cmdlineTests/standard_output_debuginfo_ethdebug_compatible/input.json

The output.json file contains four JUMPDEST instructions containing a negative offset, here is one such example:

                                {
                                    "context": {
                                        "code": {
                                            "range": {
                                                "length": 0,
                                                "offset": -1
                                            },
                                            "source": {
                                                "id": 0
                                            }
                                        }
                                    },
                                    "offset": 13,
                                    "operation": {
                                        "mnemonic": "JUMPDEST"
                                    }
                                },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant