Skip to content

Commit 08ddf67

Browse files
committed
assert that indices to be cast to size_t are nonnegative
1 parent fee4ab2 commit 08ddf67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/scip/prop_symmetry.c

+3
Original file line numberDiff line numberDiff line change
@@ -3957,6 +3957,7 @@ SCIP_RETCODE addWeakSBCsSubgroup(
39573957
{
39583958
/* add element from lexorder to hashmap.
39593959
* Use insert, as duplicate entries in lexorder is not permitted. */
3960+
assert((*lexorder)[k] >= 0);
39603961
assert( ! SCIPhashmapExists(varsinlexorder, (void*) (size_t) (*lexorder)[k]) ); /* Use int as pointer */
39613962
SCIP_CALL( SCIPhashmapInsertInt(varsinlexorder, (void*) (size_t) (*lexorder)[k], k) );
39623963
}
@@ -3979,6 +3980,7 @@ SCIP_RETCODE addWeakSBCsSubgroup(
39793980
graphcomp = chosencomppercolor[j];
39803981
graphcompsize = graphcompbegins[graphcomp+1] - graphcompbegins[graphcomp];
39813982
varidx = firstvaridxpercolor[j];
3983+
assert(varidx >= 0);
39823984

39833985
/* if the first variable was already contained in another orbit or if there are no variables left anyway, skip the
39843986
* component */
@@ -4077,6 +4079,7 @@ SCIP_RETCODE addWeakSBCsSubgroup(
40774079
int varidx;
40784080

40794081
varidx = orbit[activeorb][0];
4082+
assert(varidx >= 0);
40804083

40814084
if ( *maxnvarsorder == 0 )
40824085
{

0 commit comments

Comments
 (0)