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
2b4b9bd6
Commit
2b4b9bd6
authored
Jul 18, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Front-end: Add error-recovery code for a switch statement that ends with a…
Front-end: Add error-recovery code for a switch statement that ends with a case/default that has no statements.
parent
51b31b57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
switch.frag.out
Test/baseResults/switch.frag.out
+8
-0
intermediate.h
glslang/Include/intermediate.h
+1
-1
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+5
-0
No files found.
Test/baseResults/switch.frag.out
View file @
2b4b9bd6
...
@@ -37,6 +37,8 @@ ERROR: node is still EOpNull!
...
@@ -37,6 +37,8 @@ ERROR: node is still EOpNull!
0:23 case: with expression
0:23 case: with expression
0:23 Constant:
0:23 Constant:
0:23 2 (const int)
0:23 2 (const int)
0:21 Sequence
0:21 Branch: Break
0:26 switch
0:26 switch
0:26 condition
0:26 condition
0:26 'c' (uniform mediump int)
0:26 'c' (uniform mediump int)
...
@@ -300,6 +302,8 @@ ERROR: node is still EOpNull!
...
@@ -300,6 +302,8 @@ ERROR: node is still EOpNull!
0:128 body
0:128 body
0:128 Sequence
0:128 Sequence
0:129 default:
0:129 default:
0:128 Sequence
0:128 Branch: Break
0:133 switch
0:133 switch
0:133 condition
0:133 condition
0:133 'c' (uniform mediump int)
0:133 'c' (uniform mediump int)
...
@@ -369,6 +373,8 @@ ERROR: node is still EOpNull!
...
@@ -369,6 +373,8 @@ ERROR: node is still EOpNull!
0:23 case: with expression
0:23 case: with expression
0:23 Constant:
0:23 Constant:
0:23 2 (const int)
0:23 2 (const int)
0:21 Sequence
0:21 Branch: Break
0:26 switch
0:26 switch
0:26 condition
0:26 condition
0:26 'c' (uniform mediump int)
0:26 'c' (uniform mediump int)
...
@@ -632,6 +638,8 @@ ERROR: node is still EOpNull!
...
@@ -632,6 +638,8 @@ ERROR: node is still EOpNull!
0:128 body
0:128 body
0:128 Sequence
0:128 Sequence
0:129 default:
0:129 default:
0:128 Sequence
0:128 Branch: Break
0:133 switch
0:133 switch
0:133 condition
0:133 condition
0:133 'c' (uniform mediump int)
0:133 'c' (uniform mediump int)
...
...
glslang/Include/intermediate.h
View file @
2b4b9bd6
...
@@ -641,7 +641,7 @@ public:
...
@@ -641,7 +641,7 @@ public:
virtual
TIntermAggregate
*
getAsAggregate
()
{
return
this
;
}
virtual
TIntermAggregate
*
getAsAggregate
()
{
return
this
;
}
virtual
const
TIntermAggregate
*
getAsAggregate
()
const
{
return
this
;
}
virtual
const
TIntermAggregate
*
getAsAggregate
()
const
{
return
this
;
}
virtual
void
setOperator
(
TOperator
o
)
{
op
=
o
;
}
virtual
void
setOperator
(
TOperator
o
)
{
op
=
o
;
}
virtual
TIntermSequence
&
getSequence
()
{
return
sequence
;
}
virtual
TIntermSequence
&
getSequence
()
{
return
sequence
;
}
virtual
const
TIntermSequence
&
getSequence
()
const
{
return
sequence
;
}
virtual
const
TIntermSequence
&
getSequence
()
const
{
return
sequence
;
}
virtual
void
setName
(
const
TString
&
n
)
{
name
=
n
;
}
virtual
void
setName
(
const
TString
&
n
)
{
name
=
n
;
}
virtual
const
TString
&
getName
()
const
{
return
name
;
}
virtual
const
TString
&
getName
()
const
{
return
name
;
}
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
2b4b9bd6
...
@@ -5287,6 +5287,11 @@ TIntermNode* TParseContext::addSwitch(TSourceLoc loc, TIntermTyped* expression,
...
@@ -5287,6 +5287,11 @@ TIntermNode* TParseContext::addSwitch(TSourceLoc loc, TIntermTyped* expression,
error
(
loc
,
"last case/default label not followed by statements"
,
"switch"
,
""
);
error
(
loc
,
"last case/default label not followed by statements"
,
"switch"
,
""
);
else
else
warn
(
loc
,
"last case/default label not followed by statements"
,
"switch"
,
""
);
warn
(
loc
,
"last case/default label not followed by statements"
,
"switch"
,
""
);
// emulate a break for error recovery
lastStatements
=
intermediate
.
makeAggregate
(
intermediate
.
addBranch
(
EOpBreak
,
loc
));
lastStatements
->
setOperator
(
EOpSequence
);
switchSequence
->
push_back
(
lastStatements
);
}
}
TIntermAggregate
*
body
=
new
TIntermAggregate
(
EOpSequence
);
TIntermAggregate
*
body
=
new
TIntermAggregate
(
EOpSequence
);
...
...
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