graphic/text/bidi.cc::make_ligatures assign values which are never used

Bug #1603741 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

The method make_ligatures in graphic/text/bidi.cc has two value assignments which doesn't seem to be used. These happen on line 623 (next) and 631 (previous).

Similar assignements happen in the else if branch, but there they are used later. This does not seem to be the case for the values in the if branch. I'm not sure about the intetion here though, so I don't know if the assignments can simply be removed or if they should be used in some way later.

Found by scan-build in r8026

summary: - graphic/text/bidi.cc::make_ligatures has assign values which are never
- used
+ graphic/text/bidi.cc::make_ligatures assign values which are never used
Revision history for this message
GunChleoc (gunchleoc) wrote :

These 2 variables are declared outside of the loop, to their values persist throughout the lifetime of the loop and change the loop's behaviour for the next pass. The lines you mention are about skipping diacritics, so the loop can analyze which forms of the basic characters to pick (each Arabic character has a final form, and some of them also have a medial and an initial form).

Changed in widelands:
status: New → Invalid
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>These 2 variables are declared outside of the loop, to their values persist throughout the lifetime of the loop and change the loop's behaviour for the next pass.

But line 610 and 611 will always overwrite the value of these two variables before they are used? So if the code ends up in the if branch and sets these values, I don't see how they survive and can affect the next loop. Let me know if I'm missing something.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Looks like this was fixed in r8487. It no longer shows up in a scan-build check of recent trunk.

Changed in widelands:
importance: Undecided → Low
milestone: none → build20-rc1
status: Invalid → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.