Make RealEquals only compare the data bytes.

Fixes run/t/template_class_13_* regressions introduced in [r401].
This commit is contained in:
Christian Kamm
2008-07-27 18:52:40 +02:00
parent ad17af1e26
commit 8485be7238
2 changed files with 3 additions and 1 deletions

View File

@@ -1498,7 +1498,7 @@ int RealEquals(real_t x1, real_t x2)
/* In some cases, the REALPAD bytes get garbage in them,
* so be sure and ignore them.
*/
memcmp(&x1, &x2, sizeof(real_t)) == 0;
memcmp(&x1, &x2, REAL_T_SIZE - REAL_T_PAD) == 0;
}
int RealExp::equals(Object *o)

View File

@@ -213,6 +213,8 @@ typedef d_uns32 d_dchar;
#include "d-gcc-real.h"
#else
typedef long double real_t;
#define REAL_T_SIZE 12
#define REAL_T_PAD 2
#endif
// Modify OutBuffer::writewchar to write the correct size of wchar