Zcoin implementation bug enabled attacker to create 548, 000 Zcoins
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Tue Mar 7 07:34:54 PST 2017
Jack Stouffer wrote:
> On Tuesday, 7 March 2017 at 15:05:45 UTC, ketmar wrote:
>> only for primitive types, sadly.
>>
>> void main () {
>> Object a, b;
>> a == b;
>> }
>>
>> oops. no more error messages. yes, i know that this invokes
>> `opEquals()`, and `opEquals()` can have side-effects. but what are the
>> chances of writing such code *intentionally*?
>
> Hmm, I guess the compiler can (and should) output an error message if it
> knows that opEquals is `pure`.
>
> https://issues.dlang.org/show_bug.cgi?id=17245
yet Object's `opEquals()` is not pure (and it cannot be, to allow non-pure
overloads). still, the code i've written has no sense.
More information about the Digitalmars-d
mailing list