Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polly/include/polly/ScheduleTreeTransform.h:52: assert in wrong place ? #91235

Closed
dcb314 opened this issue May 6, 2024 · 1 comment · Fixed by #93505
Closed

polly/include/polly/ScheduleTreeTransform.h:52: assert in wrong place ? #91235

dcb314 opened this issue May 6, 2024 · 1 comment · Fixed by #93505

Comments

@dcb314
Copy link

dcb314 commented May 6, 2024

Static analyser cppcheck says:

polly/include/polly/ScheduleTreeTransform.h:52:7: style: Statements following 'return' will never be executed. [unreachableCode]

Source code is

case isl_schedule_node_set:
  return getDerived().visitSet(Node.as<isl::schedule_node_set>(),
                               std::forward<Args>(args)...);
  assert(isl_schedule_node_n_children(Node.get()) >= 2);
@llvmbot
Copy link
Member

llvmbot commented May 6, 2024

@llvm/issue-subscribers-polly

Author: None (dcb314)

Static analyser cppcheck says:

polly/include/polly/ScheduleTreeTransform.h:52:7: style: Statements following 'return' will never be executed. [unreachableCode]

Source code is

case isl_schedule_node_set:
  return getDerived().visitSet(Node.as&lt;isl::schedule_node_set&gt;(),
                               std::forward&lt;Args&gt;(args)...);
  assert(isl_schedule_node_n_children(Node.get()) &gt;= 2);

kartcq added a commit to kartcq/llvm-project that referenced this issue May 28, 2024
This patch moves the unreachable assert before return statement.
Fixes llvm#91235.
efriedma-quic pushed a commit that referenced this issue May 28, 2024
This patch moves the unreachable assert before return statement.
Fixes #91235.
vg0204 pushed a commit to vg0204/llvm-project that referenced this issue May 29, 2024
This patch moves the unreachable assert before return statement.
Fixes llvm#91235.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants