X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fgenerate.cpp;h=42b24a9caa949655c6f2a475187aa573d4376447;hb=22d5405729048ee2677a1e45e309e6328de64a26;hp=6430f9d8a0e53d630e284f64ef4ab869a2f85925;hpb=3f44e477f81983c66947fe8a6d8640a3b2f9e0b3;p=libs%2Fgl.git diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index 6430f9d8..42b24a9c 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -908,6 +908,9 @@ void ExpressionResolver::visit(TernaryExpression &ternary) { BasicTypeDeclaration *basic_true = dynamic_cast(ternary.true_expr->type); BasicTypeDeclaration *basic_false = dynamic_cast(ternary.false_expr->type); + if(!basic_true || !basic_false) + return; + Compatibility compat = get_compatibility(*basic_true, *basic_false); if(compat==NOT_COMPATIBLE) return; @@ -1012,7 +1015,7 @@ void ExpressionResolver::visit_constructor(FunctionCall &call) stage inline it if that's reasonable. */ RefPtr temporary = new VariableDeclaration; temporary->type = args.front().type->name; - temporary->name = get_unused_variable_name(*current_block, "_temp", string()); + temporary->name = get_unused_variable_name(*current_block, "_temp"); temporary->init_expression = call.arguments.front(); current_block->body.insert(insert_point, temporary);