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

zavřený
otevřeno před 4 roky uživatelem Archivist · 0 komentářů
Archivist okomentoval před 4 roky

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 přiřadil(a) sobě toto před 4 roky
Archivist přidal(a) štítek
Bug
před 3 roky
Archivist přidal(a) štítek
Pitfall
před 3 roky
Archivist uzavřel(a) tento úkol před 3 roky
Přihlaste se pro zapojení do konverzace.
Bez milníku
Bez zpracovatelů
1 účastníků
Oznámení
Termín dokončení

Žádný termín dokončení.

Závislosti

Tento úkol momentálně nemá žádné závislosti.

Načítá se…
Není zde žádný obsah.