Description
Passing a raw array (e.g., double grads[2]) to grad.execute(...) causes a segmentation fault at runtime.
It seems execute_with_default_args fails to unpack the array into individual pointers. Instead of detecting the argument count mismatch, it assumes the remaining arguments are missing and pads them with nullptr. The generated gradient code then attempts to write to these null addresses.
Reproduction
#include "clad/Differentiator/Differentiator.h"
double foo(double x, double y) { return x * y; }
int main() {
auto grad = clad::gradient(foo);
double x = 3.0, y = 4.0;
// This triggers the crash
double grads[2] = {0, 0};
grad.execute(x, y, grads);
return 0;
}