Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
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
lvzhengyang
abc
Commits
ea40a958
Unverified
Commit
ea40a958
authored
May 18, 2023
by
alanminko
Committed by
GitHub
May 18, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #196 from hzeller/20221121-fix-ub
Fix undefined behavior in signed/unsigned shifting.
parents
4f0cdd21
74740dc8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
src/aig/aig/aig.h
+1
-1
src/bool/kit/kit.h
+4
-4
src/sat/bsat/satSolver.c
+5
-4
No files found.
src/aig/aig/aig.h
View file @
ea40a958
...
...
@@ -225,7 +225,7 @@ static inline Aig_Cut_t * Aig_CutNext( Aig_Cut_t * pCut ) { return
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
static
inline
unsigned
Aig_ObjCutSign
(
unsigned
ObjId
)
{
return
(
1
<<
(
ObjId
&
31
));
}
static
inline
unsigned
Aig_ObjCutSign
(
unsigned
ObjId
)
{
return
(
1
U
<<
(
ObjId
&
31
));
}
static
inline
int
Aig_WordCountOnes
(
unsigned
uWord
)
{
uWord
=
(
uWord
&
0x55555555
)
+
((
uWord
>>
1
)
&
0x55555555
);
...
...
src/bool/kit/kit.h
View file @
ea40a958
...
...
@@ -175,10 +175,10 @@ static inline unsigned Kit_DsdLitSupport( Kit_DsdNtk_t * pNtk, int Lit )
#define KIT_MAX(a,b) (((a) > (b))? (a) : (b))
#define KIT_INFINITY (100000000)
static
inline
int
Kit_CubeHasLit
(
unsigned
uCube
,
int
i
)
{
return
(
uCube
&
(
unsigned
)(
1
<<
i
))
>
0
;
}
static
inline
unsigned
Kit_CubeSetLit
(
unsigned
uCube
,
int
i
)
{
return
uCube
|
(
unsigned
)(
1
<<
i
);
}
static
inline
unsigned
Kit_CubeXorLit
(
unsigned
uCube
,
int
i
)
{
return
uCube
^
(
unsigned
)(
1
<<
i
);
}
static
inline
unsigned
Kit_CubeRemLit
(
unsigned
uCube
,
int
i
)
{
return
uCube
&
~
(
unsigned
)(
1
<<
i
);
}
static
inline
int
Kit_CubeHasLit
(
unsigned
uCube
,
int
i
)
{
return
(
uCube
&
(
unsigned
)(
1
U
<<
i
))
>
0
;
}
static
inline
unsigned
Kit_CubeSetLit
(
unsigned
uCube
,
int
i
)
{
return
uCube
|
(
unsigned
)(
1
U
<<
i
);
}
static
inline
unsigned
Kit_CubeXorLit
(
unsigned
uCube
,
int
i
)
{
return
uCube
^
(
unsigned
)(
1
U
<<
i
);
}
static
inline
unsigned
Kit_CubeRemLit
(
unsigned
uCube
,
int
i
)
{
return
uCube
&
~
(
unsigned
)(
1
U
<<
i
);
}
static
inline
int
Kit_CubeContains
(
unsigned
uLarge
,
unsigned
uSmall
)
{
return
(
uLarge
&
uSmall
)
==
uSmall
;
}
static
inline
unsigned
Kit_CubeSharp
(
unsigned
uCube
,
unsigned
uMask
)
{
return
uCube
&
~
uMask
;
}
...
...
src/sat/bsat/satSolver.c
View file @
ea40a958
...
...
@@ -511,13 +511,14 @@ static void sortrnd(void** array, int size, int(*comp)(const void *, const void
static
inline
int
sat_clause_compute_lbd
(
sat_solver
*
s
,
clause
*
c
)
{
int
i
,
lev
,
minl
=
0
,
lbd
=
0
;
for
(
i
=
0
;
i
<
(
int
)
c
->
size
;
i
++
)
unsigned
int
i
,
lev
,
minl
=
0
;
int
lbd
=
0
;
for
(
i
=
0
;
i
<
c
->
size
;
i
++
)
{
lev
=
var_level
(
s
,
lit_var
(
c
->
lits
[
i
]));
if
(
!
(
minl
&
(
1
<<
(
lev
&
31
)))
)
if
(
!
(
minl
&
(
1
U
<<
(
lev
&
31
)))
)
{
minl
|=
1
<<
(
lev
&
31
);
minl
|=
1
U
<<
(
lev
&
31
);
lbd
++
;
// printf( "%d ", lev );
}
...
...
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