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

Void function calls with literal arguments crash Clad in forward mode #988

Closed
gojakuch opened this issue Jul 18, 2024 · 0 comments · Fixed by #989
Closed

Void function calls with literal arguments crash Clad in forward mode #988

gojakuch opened this issue Jul 18, 2024 · 0 comments · Fixed by #989
Assignees

Comments

@gojakuch
Copy link
Collaborator

#include "clad/Differentiator/Differentiator.h"
#include <iostream>

void some_important_void_func(double y) {
}

double f(double x) {
  some_important_void_func(0);
  return x;
}

int main() {
  auto df = clad::differentiate(f, 0);
  df.dump();
  std::cout << "f(3)=" << f(3.0) << "; df(3)=" << df.execute(3.0) << std::endl;
  return 0;
}
@gojakuch gojakuch self-assigned this Jul 18, 2024
gojakuch added a commit to gojakuch/clad that referenced this issue Jul 18, 2024
Previously, clad used to try to synthesise a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: vgvassilev#988
gojakuch added a commit to gojakuch/clad that referenced this issue Jul 18, 2024
Previously, clad used to try to synthesise a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: vgvassilev#988
gojakuch added a commit to gojakuch/clad that referenced this issue Jul 18, 2024
Previously, clad used to try to synthesise a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: vgvassilev#988
gojakuch added a commit to gojakuch/clad that referenced this issue Jul 19, 2024
Previously, clad used to try to synthesise a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: vgvassilev#988
gojakuch added a commit to gojakuch/clad that referenced this issue Jul 19, 2024
Previously, clad used to try to synthesise a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: vgvassilev#988
gojakuch added a commit to gojakuch/clad that referenced this issue Jul 20, 2024
Previously, clad used to try to synthesise a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: vgvassilev#988
vgvassilev pushed a commit to gojakuch/clad that referenced this issue Jul 21, 2024
Previously, clad used to try to synthesise a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: vgvassilev#988
vgvassilev pushed a commit that referenced this issue Jul 21, 2024
Previously, clad used to try to synthesize a void zero literal
when differentiating a call to a void function with
literal arguments in the forward mode. This caused it to crash.

Fixes: #988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant