|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Here is a bugreport crossposted to povray.programming,
povray.bugreports and directly to Chris Young. It is a
bit hard to reproduce, but if you observe something
similar on a platform other than Linux, please let me
know.
Description of the problem:
Sometimes, povray will complain the the error message
"#while loop didn't end in file where it started." This is
observed in a #while loop containing macros.
Analysis:
I have observed this problem in the IMP POV povray
binary, based on POV 3.1e, and the official Povteam
Linux povray binary of POV 3.1e.
Based on debugging, it is related to the way POV opens
and closes files to execute a macro in a file other than
the one currently being parsed. For some reason, the
current file is closed (tokenize.c:3272 Invoke_Macro )
and re-opened (tokenize.c:3214 Return_From_Macro)
before parsing continues after the macro expansion.
The while loop parser checks if the corresponding
#while and #end tokens are in the same file
(tokenize.c:2382 Parse_Directive), based on
file-pointers. The trouble is, that the "old" file pointer
used for comparison has since been fclose'd, and
may have been recycled for another file. Most of the time,
fclose recycles the identical file pointer, but sometimes
it is a different file-pointer (pointing to the same file)
and povray decides it's thinking about different files.
This test is implemented as follows:
case WHILE_COND:
if (Cond_Stack[CS_Index].While_File != Data_File->File)
{
Error("#while loop didn't end in file where it started.");
}
Fix:
Removing the above if block prevents POV from
falsly reporting the while loop problem. The check
should be re-implemented some other way, perhaps
by reconsidering the close/open behaviour for macro
expansion.
For further information, talk to nig### [at] eisanetau
--
Nigel Stewart (nig### [at] eisanetau) http://www.eisa.net.au/~nigels/
Postgrad Research Student, RMIT University, Melbourne, Australia
All extremists should be taken out and shot.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In povray.programming Nigel Stewart <nigels> wrote:
: Sometimes, povray will complain the the error message
: "#while loop didn't end in file where it started." This is
: observed in a #while loop containing macros.
Can you post a short example pov-code?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>: Sometimes, povray will complain the the error message
>: "#while loop didn't end in file where it started." This is
>: observed in a #while loop containing macros.
>
> Can you post a short example pov-code?
This is difficult because it depends on the behavior of
fopen, which varies from platform to platform. It is possible
to make it more frequent by manipulating the source, but
I don't think I'll be able to come up with a POV file to
reproduce it reliably on other binaries. Essentially, it is
tied to manner in which fopen recycles file pointers, often
it will use the last one that was free'd, but sometimes
(on Linux anyway) it doesn't...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have been having a similar problem (with the linux version as well),
although my c programming skills leave quite a lot to be desired, so if you
could post the file and line numbers to remove and what affect this will
have it would be good.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>I have been having a similar problem (with the linux version as well),
>although my c programming skills leave quite a lot to be desired, so if you
>could post the file and line numbers to remove and what affect this will
>have it would be good.
From the file tokenize.c, comment out the following block...
(It's _near_ line 2382, in the function Parse_Directive, search on
"While", it should be the second or third....
case WHILE_COND:
/*
if (Cond_Stack[CS_Index].While_File != Data_File->File)
{
Error("#while loop didn't end in file where it started.");
}
*/
And please let us know if it solves your problem too!
--
Nigel Stewart (nig### [at] eisanetau) http://www.eisa.net.au/~nigels/
Postgrad Research Student, RMIT University, Melbourne, Australia
All extremists should be taken out and shot.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|