Skip to content

PRIVATE ALL LIKE / EXCEPT is accepted but ignored – variables leak between call levels #30

Open

Description

@ilpconsulting

Repro

PROCEDURE main
   PRIVATE ALL LIKE db_*
   PRIVATE ALL EXCEPT x*
   db_val = "inner"
ENDPROC

foxvm check → warning: PRIVATE ALL is not supported (twice), then ok.

Why it matters

This is not cosmetic. Legacy code uses PRIVATE ALL LIKE so that a routine does not overwrite the caller's variables of the same name. When the statement is ignored, the program compiles and runs, but values leak between call levels. The bugs that follow are silent and hard to trace. In the application we tested, the very first program run opens with three of these statements.

Expected

VFP semantics: any variable matching the skeleton that is created after the statement is private to the routine, and any caller variable of the same name is hidden until the routine returns.

Until that is implemented, an error is safer than a warning (or a check option that treats this warning as an error), so the gap can't go unnoticed.

Environment: foxvm 0.1.0-nightly.20261007.f38230f, win-x64.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions