Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLSL - glslangValidator crashes on calling a function as parameter to clip #804

Closed
fluxlalonde opened this issue Mar 28, 2017 · 1 comment

Comments

@fluxlalonde
Copy link

fluxlalonde commented Mar 28, 2017

float GetEntitySelectClip()
{
	return 1.0f;
}

float4 dummyPixelShader() : SV_TARGET
{
	clip(GetEntitySelectClip()); // Seg fault.
}

Call stack:
Program received signal SIGSEGV, Segmentation fault.
0x000000000054d39c in glslang::HlslParseContext::handleFunctionCall(glslang::TSourceLoc const&, glslang::TFunction*, glslang::TIntermTyped*) ()
(gdb) where
#0 0x000000000054d39c in glslang::HlslParseContext::handleFunctionCall(glslang::TSourceLoc const&, glslang::TFunction*, glslang::TIntermTyped*) ()
#1 0x0000000000564532 in glslang::HlslGrammar::acceptFunctionCall(glslang::HlslToken, glslang::TIntermTyped*&, glslang::TIntermTyped*) ()
#2 0x0000000000564bc3 in glslang::HlslGrammar::acceptPostfixExpression(glslang::TIntermTyped*&) ()
#3 0x0000000000562ffb in glslang::HlslGrammar::acceptUnaryExpression(glslang::TIntermTyped*&) ()
#4 0x00000000005631ed in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#5 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#6 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#7 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#8 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#9 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#10 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#11 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
---Type to continue, or q to quit---
#12 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#13 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#14 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#15 0x000000000056310c in glslang::HlslGrammar::acceptBinaryExpression(glslang::TIntermTyped*&, glslang::PrecedenceLevel) ()
#16 0x0000000000563258 in glslang::HlslGrammar::acceptConditionalExpression(glslang::TIntermTyped*&) ()
#17 0x0000000000563865 in glslang::HlslGrammar::acceptAssignmentExpression(glslang::TIntermTyped*&) ()
#18 0x000000000056399e in glslang::HlslGrammar::acceptExpression(glslang::TIntermTyped*&) ()
#19 0x0000000000566303 in glslang::HlslGrammar::acceptStatement(TIntermNode*&)
()
#20 0x000000000056639b in glslang::HlslGrammar::acceptCompoundStatement(TIntermNode*&) ()
#21 0x00000000005664d7 in glslang::HlslGrammar::acceptFunctionDefinition(glslang::TFunction&, TIntermNode*&, TIntermNode*&, glslang::TAttributeMap const&) ()
#22 0x000000000055f363 in glslang::HlslGrammar::acceptDeclaration(TIntermNode*&, TIntermNode*&) ()
#23 0x000000000055f4e6 in glslang::HlslGrammar::acceptCompilationUnit() ()
#24 0x0000000000533789 in glslang::HlslParseContext::parseShaderStrings(glslang---Type to continue, or q to quit---
::TPpContext&, glslang::TInputScanner&, bool) ()
#25 0x00000000004435fc in bool (anonymous namespace)::ProcessDeferred<(anonymous namespace)::DoFullParse>(TCompiler*, char const* const*, int, int const*, char const* const*, char const*, EShOptimizationLevel, TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, glslang::TIntermediate&, (anonymous namespace)::DoFullParse&, bool, glslang::TShader::Includer&, std::string) [clone .isra.341] [clone .constprop.345] ()
#26 0x0000000000443d29 in glslang::TShader::parse(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&) ()
#27 0x0000000000443e83 in glslang::TShader::parse(TBuiltInResource const*, int, bool, EShMessages) ()
#28 0x000000000043b4f7 in CompileAndLinkShaderUnits(std::vector<ShaderCompUnit, std::allocator >) ()
#29 0x000000000043d363 in CompileAndLinkShaderFiles() ()
#30 0x0000000000439032 in main ()
(gdb)

@ghost
Copy link

ghost commented Mar 31, 2017

#810.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants