[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-finance-apps
Subject:    Re: [Kde-finance-apps] [alkimia/5.0] libalkimia: Fix AlkValue::operator=(QString) w/ valueRef()
From:       Cristian_OneČ› <onet.cristian () gmail ! com>
Date:       2016-06-21 6:58:56
Message-ID: CANqZg3uOqLo6s11Qf2Hu_uSFDpa4EJjRs-RXqkm9SRSS+bDS-w () mail ! gmail ! com
[Download RAW message or body]

Pino, thanks for fixing this.

Regards,
Cristian

2016-06-20 23:25 GMT+03:00 Pino Toscano <pino@kde.org>:
> Git commit 2e6172a7d723d53ff62fc3eaf2ea7208db0fd0a7 by Pino Toscano.
> Committed on 20/06/2016 at 20:01.
> Pushed by pino into branch '5.0'.
>
> Fix AlkValue::operator=(QString) w/ valueRef()
>
> Do not set a new Private directly, since it will destroy the old one
> and invalidate the references to the internal m_val -- indeed, valgrind
> complains about that, and AlkValueTest::valueRef() fails on any
> architecture different than x86/x86_64.
>
> Instead, copy m_val from a new temporary AlkValue.
>
> M  +2    -1    libalkimia/alkvalue.cpp
>
> http://commits.kde.org/alkimia/2e6172a7d723d53ff62fc3eaf2ea7208db0fd0a7
>
> diff --git a/libalkimia/alkvalue.cpp b/libalkimia/alkvalue.cpp
> index 295ac06..9a52c1a 100644
> --- a/libalkimia/alkvalue.cpp
> +++ b/libalkimia/alkvalue.cpp
> @@ -462,7 +462,8 @@ const AlkValue & AlkValue::operator=(double right)
>
>  const AlkValue & AlkValue::operator=(const QString & right)
>  {
> -  d = AlkValue(right, QLatin1Char('.')).d;
> +  AlkValue other(right, QLatin1Char('.'));
> +  d->m_val = other.d->m_val;
>    return *this;
>  }
>
>
_______________________________________________
Kde-finance-apps mailing list
Kde-finance-apps@kde.org
https://mail.kde.org/mailman/listinfo/kde-finance-apps

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic