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
9d4a1b24
Commit
9d4a1b24
authored
Oct 24, 2017
by
Aaron Muir Hamilton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preprocessor: Evaluate INT_MIN % -1 to 0.
parent
047b65f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
cppIntMinOverNegativeOne.frag
Test/cppIntMinOverNegativeOne.frag
+4
-0
Pp.cpp
glslang/MachineIndependent/preprocessor/Pp.cpp
+1
-1
No files found.
Test/cppIntMinOverNegativeOne.frag
View file @
9d4a1b24
#if (-2147483648 / -1) != 0
#error INT_MIN / -1 should yield 0, something went wrong.
#endif
#if (-2147483648 % -1) != 0
#error INT_MIN % -1 should yield 0, something went wrong.
#endif
\ No newline at end of file
glslang/MachineIndependent/preprocessor/Pp.cpp
View file @
9d4a1b24
...
...
@@ -352,7 +352,7 @@ namespace {
int
op_sub
(
int
a
,
int
b
)
{
return
a
-
b
;
}
int
op_mul
(
int
a
,
int
b
)
{
return
a
*
b
;
}
int
op_div
(
int
a
,
int
b
)
{
return
a
==
INT_MIN
&&
b
==
-
1
?
0
:
a
/
b
;
}
int
op_mod
(
int
a
,
int
b
)
{
return
a
%
b
;
}
int
op_mod
(
int
a
,
int
b
)
{
return
a
==
INT_MIN
&&
b
==
-
1
?
0
:
a
%
b
;
}
int
op_pos
(
int
a
)
{
return
a
;
}
int
op_neg
(
int
a
)
{
return
-
a
;
}
int
op_cmpl
(
int
a
)
{
return
~
a
;
}
...
...
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