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

Fermé
créé il y a 4 ans par Archivist · 0 commentaires

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 s'est assigné cela il y a 4 ans
Archivist a ajouté l’étiquette
Bug
il y a 4 ans
Archivist a ajouté l’étiquette
Pitfall
il y a 4 ans
Archivist a référencé ce ticket depuis une révision il y a 3 ans
Archivist a fermé ce ticket il y a 3 ans
Connectez-vous pour rejoindre cette conversation.
Pas d'étiquette
Bug
Aucun jalon
Pas d'assignataires
1 participants
Notifications
Échéance

Aucune échéance n'a été définie.

Dépendances

Ce ticket n'a actuellement pas de dépendance.

Chargement…
Il n'existe pas encore de contenu.