Skip to content

[gnovm] Misleading function names: PopUntil* functions #4981

@davd-gzl

Description

@davd-gzl

Severity: Informational

Description

Two functions in machine.go have confusing names that suggest they always pop frames, but they only pop when the target is found.

1. PopUntilLastCallFrame() (line 2172)

What the name suggests: Always pops frames while searching

What it actually does:

  • If call frame found → pops frames and returns it
  • If NOT found → doesn't pop anything, returns nil

2. PopUntilLastReviveFrame() (line 2184)

What the name suggests: Always pops frames while searching

What it actually does:

  • If revive frame found → pops frames and returns it
  • If NOT found → doesn't pop anything, returns nil

Locations

  • gnovm/pkg/gnolang/machine.go lines 2172-2182, 2184-2193
  • Used in op_call.go and other files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions