Branch: Tag:


2008-04-20 17:45:48 by Henrik Grubbström (Grubba) <>

Improved robustness of test_hash_value("hello").
The optimizer threw away the string "hello" from a() before starting on b(),
there was thus a risk that the string "hello" in b() would be allocated
somewhere else and get a different hash value. This seems to have happened
more frequently on 64-bit pikes than on 32-bit pikes, but the potential for
the problem was there on both.

Rev: src/

1:   START_MARKER - test_true([["$Id:,v 1.801 2008/03/22 14:10:05 grubba Exp $"]]); + test_true([["$Id:,v 1.802 2008/04/20 17:45:48 grubba Exp $"]]);      // This triggered a bug only if run sufficiently early.   test_compile_any([[#pike 7.2]])
9675:   // - hash_value   define(test_hash_value, [[    test_true(intp(hash_value($1))) +  dnl Make sure the value to hash has a chance at surviving the optimizer... +  test_do(add_constant("test_value", $1))    test_eq(hash_value($1),hash_value($1)) -  +  test_do(add_constant("test_value"))   ]])   test_hash_value(77)   test_hash_value(5.0)