[Zorba-coders] [Bug 1020942] Re: vector subscript out of range assertion hit on windows

2012-07-05 Thread Dennis Knochenwefel
** Changed in: zorba
   Status: In Progress => Fix Committed

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/1020942

Title:
  vector subscript out of range assertion hit on windows

Status in Zorba - The XQuery Processor:
  Fix Committed

Bug description:
  in src/zorbatypes/binary.cpp a lot of vectors are accessed with [0],
  e.g.:

  aBase64.theData.resize(
copy_without_ws( aString, aLength, &aBase64.theData[0] )
  );

  if in this case aLength is of size 0 the assertion "vector subscript
  out of range" is hit on windows in debug build. This happens because
  size == pos in std::vector implementation on windows:

reference operator[](size_type _Pos)
{   // subscript mutable sequence
 #if _ITERATOR_DEBUG_LEVEL == 2
if (size() <= _Pos)
{   // report error
_DEBUG_ERROR("vector subscript out of range");
_SCL_SECURE_OUT_OF_RANGE;
}

  Therefore, before accessing a vector with [0] one must check whether
  the size of the vector is > 0. Otherwise the mentioned assertion will
  trigger.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/1020942/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Bug 1020942] Re: vector subscript out of range assertion hit on windows

2012-07-04 Thread Paul J. Lucas
** Changed in: zorba
   Status: New => In Progress

** Branch linked: lp:~paul-lucas/zorba/bug-1020942

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/1020942

Title:
  vector subscript out of range assertion hit on windows

Status in Zorba - The XQuery Processor:
  In Progress

Bug description:
  in src/zorbatypes/binary.cpp a lot of vectors are accessed with [0],
  e.g.:

  aBase64.theData.resize(
copy_without_ws( aString, aLength, &aBase64.theData[0] )
  );

  if in this case aLength is of size 0 the assertion "vector subscript
  out of range" is hit on windows in debug build. This happens because
  size == pos in std::vector implementation on windows:

reference operator[](size_type _Pos)
{   // subscript mutable sequence
 #if _ITERATOR_DEBUG_LEVEL == 2
if (size() <= _Pos)
{   // report error
_DEBUG_ERROR("vector subscript out of range");
_SCL_SECURE_OUT_OF_RANGE;
}

  Therefore, before accessing a vector with [0] one must check whether
  the size of the vector is > 0. Otherwise the mentioned assertion will
  trigger.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/1020942/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp