viperproject / viperproject/silver

Incorrect positions in Method AST nodes

Open
#489 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug critical parser
Dominant language
Scala
Stars
100
Forks
53
Avg merge
8h 10m
Merged PRs (30d)
2

Description

SilFrontend generates AST nodes with incorrect positions. In particular, the start position of methods is wrong (seems to be the same as their end position for some reason).

This is a critical bug because currently, the soundness of the caching mechanism in ViperServer (hence, also in Viper IDE and all of the frontend verifiers that use ViperServer) depends on the method position information.

To reproduce the problem, simply execute sbt testOnly *AstPositionsTests to run the test defined in src/test/scala/AstPositionsTests.scala.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run sbt testOnly *AstPositionsTests and inspect src/test/scala/AstPositionsTests.scala to understand the expected method positions. Trace how SilFrontend creates method AST nodes and compare their start and end positions. Done means the position tests pass and method positions are correct for the caching use described.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.