[Bug 72686] GLSL preprocessor does not eat comments correctly

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 29 14:30:32 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=72686

Carl Worth <cworth at cworth.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://patchwork.freedeskto
                   |                            |p.org/patch/19079/

--- Comment #5 from Carl Worth <cworth at cworth.org> ---
(In reply to comment #4)

> The above commit, which I believe is the fix you mentioned, causes this code
> to produce a preprocessor error:
> 
> /*
> */  // a comment
...
> 0:2(60): preprocessor error: syntax error, unexpected $end
> 
> This happens only if the /* */ contains newlines, and only if a single-line
> comment follows the multi-line comment. Two multi-line comments works fine.

Yes, Petri, that's the commit I made to fix the originally-reported bug.

And thanks for finding this regression in my commit!

It's an extremely narrow problem, and you described it precisely. It can only
with a multi-line comment, (spanning more than one line), followed immediately
by a single-line comment without any intervening newline.

I've just sent a patch to the list to fix the bug, and also a patch that
adds a test case based on your description of the problem.

Thanks again! This was a ''fun'' problem to solve. (I was stumped for quite
a while. Then once I had a working fix in hand, went through three different
fixes as I realized that the descriptions I was writing for the fix didn't
match the precise symptoms of the bug. Each time, I had to look closer to
find that I was fixing some non-problem that only accidentally resolved the
real bug.)

It's nice to see in the final version that the fix, its description, and the
test case all match each other quite precisely.

-Carl

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20140129/c39593c8/attachment.html>


More information about the intel-3d-bugs mailing list