Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.software-eng > #2657 > unrolled thread

Infinite recursion detection criteria: (test of formatting)

Started byolcott <NoOne@NoWhere.com>
First post2021-04-18 22:34 -0500
Last post2021-04-18 22:34 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.software-eng


Contents

  Infinite recursion detection criteria: (test of formatting) olcott <NoOne@NoWhere.com> - 2021-04-18 22:34 -0500

#2657 — Infinite recursion detection criteria: (test of formatting)

Fromolcott <NoOne@NoWhere.com>
Date2021-04-18 22:34 -0500
SubjectInfinite recursion detection criteria: (test of formatting)
Message-ID<EOadndbVgOajZ-H9nZ2dnUU7-RmdnZ2d@giganews.com>
Infinite recursion detection criteria:
(1) Function X() is called twice in sequence from the same machine 
address of Y().
(2) With the same parameters to X().
(3) With no conditional branch or indexed jump instructions in Y().
(4) With no function call returns from X().

The following code is written in "C"

void X(u32 P, u32 I)
{
   Simulate(P, I);
}

void Y(u32 P)
{
   X(P, P);
}

int main()
{
   X((u32)Y, (u32)Y);
}

When X() simulates the machine language of Y() and examines resulting 
execution trace after simulating each machine instruction of Y() then 
X() can apply the criteria provided above to correctly decide to stop 
simulating Y() on the basis that Y() would otherwise cause X() have 
infinite execution.


-- 
Copyright 2021 Pete Olcott

"Great spirits have always encountered violent opposition from mediocre 
minds." Einstein

[toc] | [standalone]


Back to top | Article view | comp.software-eng


csiph-web