After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705391 - Not reachable code in tree.c
Not reachable code in tree.c
Status: RESOLVED DUPLICATE of bug 705392
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-03 10:02 UTC by Gaurav
Modified: 2013-08-04 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Removes the never reachable if-else condition (463 bytes, application/octet-stream)
2013-08-03 10:02 UTC, Gaurav
Details

Description Gaurav 2013-08-03 10:02:32 UTC
Created attachment 250756 [details]
Removes the never reachable if-else condition

In file :
https://git.gnome.org/browse/libxml2/tree/tree.c
Function : xmlDOMWrapNsMapAddItem

At line : 7846
  if ((position != -1) && (position != 0))
	return(NULL);
i.e if value of position can either be 1 or 0.

Line: 7882
   if (map->first == NULL) {
       ----Some COde ----
   } else if (position == -1) {
       ---Some COde---
   } else if (position == 0) {
       ----Some Code ----
   } else
	return(NULL);

In above if-else statements if map-first is not NULL then:
one of the else-if condition will be executed as value of position can either be 1 or 0.
So, the final else condition will never be executed.

Patch for fix is attached.
Comment 1 André Klapper 2013-08-04 12:22:49 UTC

*** This bug has been marked as a duplicate of bug 705392 ***