Skip to content

analyze write in nested try#1291

Merged
Hecate2 merged 3 commits intoneo-project:masterfrom
Hecate2:improve-write-in-try-analyzer
Feb 7, 2025
Merged

analyze write in nested try#1291
Hecate2 merged 3 commits intoneo-project:masterfrom
Hecate2:improve-write-in-try-analyzer

Conversation

@Hecate2
Copy link
Contributor

@Hecate2 Hecate2 commented Feb 6, 2025

try:
  try:
    Write()
  finally:
    ...
except:
  ...

This is also considered unsafe, because the Write() in the internal try may throw and be caught by the external try. Thus it is ambiguous whether the internal Write() is reverted.

@Hecate2 Hecate2 marked this pull request as draft February 6, 2025 04:41
@Hecate2
Copy link
Contributor Author

Hecate2 commented Feb 6, 2025

It is not checking writes in a catch nested in a try. Fixing.

@Hecate2 Hecate2 marked this pull request as ready for review February 6, 2025 05:21
@Hecate2 Hecate2 force-pushed the improve-write-in-try-analyzer branch from 806f623 to a9a35dc Compare February 6, 2025 07:36
@Hecate2 Hecate2 force-pushed the improve-write-in-try-analyzer branch from a9a35dc to b64741f Compare February 6, 2025 07:38
@Hecate2 Hecate2 merged commit 4d85198 into neo-project:master Feb 7, 2025
3 checks passed
Jim8y added a commit that referenced this pull request Mar 10, 2025
* master:
  Update Copyright date (#1299)
  Add NotaryAssisted transaction attribute type (#983)
  Update submodule (#1296)
  dumpnef intakes manifest to find method starts (#1293)
  Optimize (#1294)
  CatchOnlySystemExceptionAnalyzer (#1292)
  analyze write in nested try (#1291)
Jim8y pushed a commit that referenced this pull request Aug 3, 2025
* analyze write in nested try
* handle write in try{try catch{write}}
* add recursive call in tests
Jim8y pushed a commit that referenced this pull request Aug 18, 2025
* analyze write in nested try

* handle write in try{try catch{write}}

* add recursive call in tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants