Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
091c30c7
Commit
091c30c7
authored
Aug 14, 2013
by
Andreas Seltenreich
Browse files
Fix bogus use of BITSET_ELEM in rbitset_set_range().
parent
cf3d7fb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/adt/raw_bitset.h
View file @
091c30c7
...
...
@@ -432,24 +432,24 @@ static inline void rbitset_set_range(unsigned *bitset, size_t from,
/* do we want to set the bits in the range? */
if
(
val
)
{
if
(
from_pos
==
to_pos
)
{
BITSET_ELEM
(
bitset
,
from_pos
)
|=
from_unit_mask
&
to_unit_mask
;
bitset
[
from_pos
]
|=
from_unit_mask
&
to_unit_mask
;
}
else
{
size_t
i
;
BITSET_ELEM
(
bitset
,
from_pos
)
|=
from_unit_mask
;
BITSET_ELEM
(
bitset
,
to_pos
)
|=
to_unit_mask
;
bitset
[
from_pos
]
|=
from_unit_mask
;
bitset
[
to_pos
]
|=
to_unit_mask
;
for
(
i
=
from_pos
+
1
;
i
<
to_pos
;
++
i
)
BITSET_ELEM
(
bitset
,
i
)
=
~
0u
;
bitset
[
i
]
=
~
0u
;
}
}
else
{
/* ... or clear them? */
if
(
from_pos
==
to_pos
)
{
BITSET_ELEM
(
bitset
,
from_pos
)
&=
~
(
from_unit_mask
&
to_unit_mask
);
bitset
[
from_pos
]
&=
~
(
from_unit_mask
&
to_unit_mask
);
}
else
{
size_t
i
;
BITSET_ELEM
(
bitset
,
from_pos
)
&=
~
from_unit_mask
;
BITSET_ELEM
(
bitset
,
to_pos
)
&=
~
to_unit_mask
;
bitset
[
from_pos
]
&=
~
from_unit_mask
;
bitset
[
to_pos
]
&=
~
to_unit_mask
;
for
(
i
=
from_pos
+
1
;
i
<
to_pos
;
++
i
)
BITSET_ELEM
(
bitset
,
i
)
=
0
;
bitset
[
i
]
=
0
;
}
}
}
...
...
Write
Preview
Supports
Markdown
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