Overview
The provided source identifies self-modifying code as one example of a reentrant instruction pattern: an instruction or instruction sequence that can execute more than once during a single test run. Other examples listed in the same context include procedure calls, recurring interrupts, and user-defined loops.
Role in test-program generation
The evidence describes Genesys-Pro as separating test-program generation into two levels:
- Stream-level generation, which determines which instructions appear in a test and their order.
- Instruction-level generation, which creates specific instruction instances.
Within stream-level generation, the stream solver supports controlled generation of reentrant instructions. Self-modifying code is included among the supported examples of such reentrant behavior.
Control considerations
The same source notes that randomly generated loops are prohibited to protect against generating infinite loops. This constraint is presented alongside the discussion of reentrant instruction generation, indicating that controlled generation is important when producing instruction streams that can execute repeatedly.
Evidence limitations
The provided evidence does not define the internal mechanics of self-modifying code or describe how generated self-modifying code changes instructions at runtime. It only establishes that, in the Genesys-Pro test-generation context, self-modifying code is treated as an example of reentrant behavior that the stream solver can generate in a controlled manner.