Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
4ee5193b
Commit
4ee5193b
authored
Feb 08, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Non-functional: GLSL: Fix #1242; don't pass reference to nullptr.
parent
2f658e1f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
Intermediate.cpp
glslang/MachineIndependent/Intermediate.cpp
+3
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+12
-8
ParseHelper.h
glslang/MachineIndependent/ParseHelper.h
+1
-1
No files found.
glslang/MachineIndependent/Intermediate.cpp
View file @
4ee5193b
...
...
@@ -376,7 +376,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
return
node
;
}
TIntermTyped
*
TIntermediate
::
addBuiltInFunctionCall
(
const
TSourceLoc
&
loc
,
TOperator
op
,
bool
unary
,
TIntermNode
*
childNode
,
const
TType
&
returnType
)
TIntermTyped
*
TIntermediate
::
addBuiltInFunctionCall
(
const
TSourceLoc
&
loc
,
TOperator
op
,
bool
unary
,
TIntermNode
*
childNode
,
const
TType
&
returnType
)
{
if
(
unary
)
{
//
...
...
@@ -420,7 +421,7 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o
//
// Make sure we have an aggregate. If not turn it into one.
//
if
(
node
)
{
if
(
node
!=
nullptr
)
{
aggNode
=
node
->
getAsAggregate
();
if
(
aggNode
==
nullptr
||
aggNode
->
getOp
()
!=
EOpNull
)
{
//
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
4ee5193b
...
...
@@ -950,7 +950,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
if
(
builtIn
&&
fnCandidate
->
getNumExtensions
())
requireExtensions
(
loc
,
fnCandidate
->
getNumExtensions
(),
fnCandidate
->
getExtensions
(),
fnCandidate
->
getName
().
c_str
());
if
(
arguments
)
{
if
(
arguments
!=
nullptr
)
{
// Make sure qualifications work for these arguments.
TIntermAggregate
*
aggregate
=
arguments
->
getAsAggregate
();
for
(
int
i
=
0
;
i
<
fnCandidate
->
getParamCount
();
++
i
)
{
...
...
@@ -988,7 +988,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
if
(
builtIn
&&
fnCandidate
->
getBuiltInOp
()
!=
EOpNull
)
{
// A function call mapped to a built-in operation.
result
=
handleBuiltInFunctionCall
(
loc
,
*
arguments
,
*
fnCandidate
);
result
=
handleBuiltInFunctionCall
(
loc
,
arguments
,
*
fnCandidate
);
}
else
{
// This is a function call not mapped to built-in operator.
// It could still be a built-in function, but only if PureOperatorBuiltins == false.
...
...
@@ -1036,20 +1036,24 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
return
result
;
}
TIntermTyped
*
TParseContext
::
handleBuiltInFunctionCall
(
TSourceLoc
loc
,
TIntermNode
&
arguments
,
TIntermTyped
*
TParseContext
::
handleBuiltInFunctionCall
(
TSourceLoc
loc
,
TIntermNode
*
arguments
,
const
TFunction
&
function
)
{
checkLocation
(
loc
,
function
.
getBuiltInOp
());
TIntermTyped
*
result
=
intermediate
.
addBuiltInFunctionCall
(
loc
,
function
.
getBuiltInOp
(),
function
.
getParamCount
()
==
1
,
&
arguments
,
function
.
getType
());
arguments
,
function
.
getType
());
if
(
obeyPrecisionQualifiers
())
computeBuiltinPrecisions
(
*
result
,
function
);
if
(
result
==
nullptr
)
{
error
(
arguments
.
getLoc
(),
" wrong operand type"
,
"Internal Error"
,
"built in unary operator function. Type: %s"
,
static_cast
<
TIntermTyped
*>
(
&
arguments
)
->
getCompleteString
().
c_str
());
if
(
result
==
nullptr
)
{
if
(
arguments
==
nullptr
)
error
(
loc
,
" wrong operand type"
,
"Internal Error"
,
"built in unary operator function. Type: %s"
,
""
);
else
error
(
arguments
->
getLoc
(),
" wrong operand type"
,
"Internal Error"
,
"built in unary operator function. Type: %s"
,
static_cast
<
TIntermTyped
*>
(
arguments
)
->
getCompleteString
().
c_str
());
}
else
if
(
result
->
getAsOperator
())
builtInOpCheck
(
loc
,
function
,
*
result
->
getAsOperator
());
...
...
glslang/MachineIndependent/ParseHelper.h
View file @
4ee5193b
...
...
@@ -309,7 +309,7 @@ public:
TFunction
*
handleFunctionDeclarator
(
const
TSourceLoc
&
,
TFunction
&
function
,
bool
prototype
);
TIntermAggregate
*
handleFunctionDefinition
(
const
TSourceLoc
&
,
TFunction
&
);
TIntermTyped
*
handleFunctionCall
(
const
TSourceLoc
&
,
TFunction
*
,
TIntermNode
*
);
TIntermTyped
*
handleBuiltInFunctionCall
(
TSourceLoc
,
TIntermNode
&
arguments
,
const
TFunction
&
function
);
TIntermTyped
*
handleBuiltInFunctionCall
(
TSourceLoc
,
TIntermNode
*
arguments
,
const
TFunction
&
function
);
void
computeBuiltinPrecisions
(
TIntermTyped
&
,
const
TFunction
&
);
TIntermNode
*
handleReturnValue
(
const
TSourceLoc
&
,
TIntermTyped
*
);
void
checkLocation
(
const
TSourceLoc
&
,
TOperator
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment