[llvm-bugs] [Bug 27645] Wrong "error: cannot jump from this indirect goto statement to one of its possible targets"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 4 19:56:38 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27645

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #4 from Richard Smith <richard-llvm at metafoo.co.uk> ---
GCC fails to validate that indirect gotos are sane (note that it accepts your
code even if you change '&&first' to '&&second'). Clang assumes that any
indirect goto can jump to any possible target within the function.

The dynamic execution behavior of your program is irrelevant. Statically, it
has an indirect goto (the first one), and it has a label whose address is taken
('second:'), and it would be ill-formed to jump from that goto to that label,
so the program is ill-formed.

We are not likely to change this behavior to allow your code.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160505/a0cf1f0b/attachment.html>


More information about the llvm-bugs mailing list