A forum for Spin users
You are not logged in.
Hi folks,
I potentially found a bug in Spin today. Consider the following minimal example:
init{
byte childPid = run SomeProc();
assert(childPid == 1);
}
proctype SomeProc(){
skip;
}
This model is syntactically correct (as confirmed by spin) and it violates none of the restrictions for the run-expression mentioned on the man pages. However, as it turns out, this model is not translated into compilable C-code by Spin leading to the following compile error:
pan.c: In function ‘addproc’:
pan.c:830:39: error: ‘II’ undeclared (first use in this function)
((P0 *)pptr(h))->childPid = addproc(II, 1, 1);
^
I guess this should be fixed.
By the way, the example compiles (and verifies) correctly if we do not use run in the init expression for the variable childPid (i.e., declaring childPid first and then using the run expression as right-hand side of an assignment).
Cheers,
Christian
Offline