Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2004-07-05 16:32:14 +0400
committerZoltan Varga <vargaz@gmail.com>2004-07-05 16:32:14 +0400
commitde4717d611914ccfbbee258eae702098adb4f4e7 (patch)
tree69a81339c326921853377650c2d530d46b1d5bf9
parentf3ae3308adf4089a494b365268ed28cc33febd56 (diff)
Merge from HEAD.
svn path=/branches/mono-1-0/mono/; revision=30738
-rw-r--r--mono/interpreter/ChangeLog6
-rw-r--r--mono/interpreter/interp.c2
-rw-r--r--mono/interpreter/mintops.h10
3 files changed, 17 insertions, 1 deletions
diff --git a/mono/interpreter/ChangeLog b/mono/interpreter/ChangeLog
index 2c2d176ef2f..088f0756976 100644
--- a/mono/interpreter/ChangeLog
+++ b/mono/interpreter/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mintops.h: Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Add support for unaligned access on little endian machines.
+
+ * interp.c:Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Fix crash seen on amd64.
+
2004-06-24 David Waite <mass@akuma.org>
* interp.c: change to C90-style comments from C99/C++-style
diff --git a/mono/interpreter/interp.c b/mono/interpreter/interp.c
index 872fad14aae..3f7ad24660d 100644
--- a/mono/interpreter/interp.c
+++ b/mono/interpreter/interp.c
@@ -1164,7 +1164,7 @@ handle_enum:
}
}
- if (method->klass->valuetype)
+ if (method->klass->valuetype && obj)
/* Unbox the instance, since valuetype methods expect an interior pointer. */
obj = mono_object_unbox (obj);
diff --git a/mono/interpreter/mintops.h b/mono/interpreter/mintops.h
index ab559de7ac6..e787526e2fe 100644
--- a/mono/interpreter/mintops.h
+++ b/mono/interpreter/mintops.h
@@ -1,6 +1,8 @@
#ifndef __INTERPRETER_MINTOPS_H
#define __INTERPRETER_MINTOPS_H
+#include <glib.h>
+
typedef enum
{
MintOpNoArgs,
@@ -29,11 +31,19 @@ enum {
#undef OPDEF
#if NO_UNALIGNED_ACCESS
+# if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define READ32(x) (((guint16 *)(x)) [0] | ((guint16 *)(x)) [1] << 16)
+#define READ64(x) ((guint64)((guint16 *)(x)) [0] | \
+ (guint64)((guint16 *)(x)) [1] << 16 | \
+ (guint64)((guint16 *)(x)) [2] << 32 | \
+ (guint64)((guint16 *)(x)) [3] << 48)
+# else
#define READ32(x) (((guint16 *)(x)) [0] << 16 | ((guint16 *)(x)) [1])
#define READ64(x) ((guint64)((guint16 *)(x)) [0] << 48 | \
(guint64)((guint16 *)(x)) [1] << 32 | \
(guint64)((guint16 *)(x)) [2] << 16 | \
(guint64)((guint16 *)(x)) [3])
+# endif
#else /* unaligned access OK */
#define READ32(x) (*(guint32 *)(x))
#define READ64(x) (*(guint64 *)(x))