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

닫힘
Archivist4 년 전을 오픈 · 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 자체적으로 할당됨 4 년 전
Archivist added the
Bug
label 4 년 전
Archivist added the
Pitfall
label 4 년 전
Archivist closed this issue 3 년 전
로그인하여 이 대화에 참여
레이블 없음
Bug
마일스톤 없음
담당자 없음
참여자 1명
알림
마감일

마감일이 설정되지 않았습니다.

의존성

이 이슈는 어떠한 의존성도 가지지 않습니다.

불러오는 중...
아직 콘텐츠가 없습니다.