You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go enforces a syntactic reachability analysis for returns, while C never required that returns be reachable and C compilers which do reachability use more sophisticated algorighms.
Some situations where the return statement is considered reachable (or at least not an issue) by C are not considered reachable by Go.
It appears that cxgo has implemented a bit of checking to implicitly add missing returns (see postproc.go:fixImplicitReturnStmts).
However, I've found a test case which is improperly handled.
I believe the last line of this function should have an (actually unreachable) return 0 added to fool Go into believing there is a reachable return 0.
DISTRIBUTION STATEMENT “A”. (Approved for public release. Distribution is unlimited.)
This material is based upon work supported by DARPA under Contract No. HR001122C0047. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of DARPA. DISTRIBUTION STATEMENT “A”. (Approved for public release. Distribution is unlimited.)
The text was updated successfully, but these errors were encountered:
Possibly related to #10
Go enforces a syntactic reachability analysis for
return
s, while C never required that returns be reachable and C compilers which do reachability use more sophisticated algorighms.Some situations where the
return
statement is considered reachable (or at least not an issue) by C are not considered reachable by Go.It appears that
cxgo
has implemented a bit of checking to implicitly add missing returns (seepostproc.go:fixImplicitReturnStmts
).However, I've found a test case which is improperly handled.
I believe the last line of this function should have an (actually unreachable)
return 0
added to fool Go into believing there is a reachablereturn 0
.DISTRIBUTION STATEMENT “A”. (Approved for public release. Distribution is unlimited.)
This material is based upon work supported by DARPA under Contract No. HR001122C0047. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of DARPA. DISTRIBUTION STATEMENT “A”. (Approved for public release. Distribution is unlimited.)
The text was updated successfully, but these errors were encountered: