#1 gp::function crashes spectacularly on calling a copy

Затворено
отворено пре 4 година од Archivist · 0 коментара
Archivist коментирира пре 4 година

Test case

struct function_test : public test_scaffold {
	function_test() {
		name = __FILE__ "_function_copy:3";
	}


	virtual int run() {
		int res = 0;
		gp::function<float(vec3)> l_sdf_b = gp::sphere_sdf<float>({0.0,0.0,0.0}, 1.0);

		gp::function<float(vec3)> sdf = l_sdf_b;

		gp_config::assertion(sdf(vec3(0,0,0)) == -1, "Bad sdf");

		return res;
	}
};

append_test dummy_ml8576f(new function_test{});

Expected result

Either the sphere_sdf fails or generate a function that is invalid and the assertion is triggered, or the assertion is met and the function returns normally.

Results

Fails with SIGSEGV

## Test case ```c++ struct function_test : public test_scaffold { function_test() { name = __FILE__ "_function_copy:3"; } virtual int run() { int res = 0; gp::function<float(vec3)> l_sdf_b = gp::sphere_sdf<float>({0.0,0.0,0.0}, 1.0); gp::function<float(vec3)> sdf = l_sdf_b; gp_config::assertion(sdf(vec3(0,0,0)) == -1, "Bad sdf"); return res; } }; append_test dummy_ml8576f(new function_test{}); ``` ## Expected result Either the `sphere_sdf` fails or generate a function that is invalid and the assertion is triggered, or the assertion is met and the function returns normally. ## Results Fails with SIGSEGV
Archivist self-assigned this пре 4 година
Archivist added the
Bug
label пре 4 година
Archivist added the
Pitfall
label пре 4 година
Archivist поменуо овај задатак у комит пре 3 година
Пријавите се да се прикључе у овом разговору.
Нема лабеле
Bug
Нема фазе
No Assignees
1 учесника
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Још нема садржаја.