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

Kapalı
Archivist tarafından 4 yıl önce açıldı · 0 yorum
Archivist 4 yıl önce yorum yaptı

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 4 yıl önce kendini atadı
Archivist
Bug
4 yıl önce etiketini ekledi
Archivist
Pitfall
4 yıl önce etiketini ekledi
Archivist 3 yıl önce konusunu kapattı
Bu konuşmaya katılmak için oturum aç.
Kilometre Taşı Yok
Atanan Kişi Yok
1 Katılımcı
Bildirimler
Bitiş Tarihi

Bitiş tarihi atanmadı.

Bağımlılıklar

Bu konu henüz bir bağımlılık içermiyor.

Yükleniyor…
Henüz bir içerik yok.