Marcel Moolenaar ae04949bff Fix unaligned memory accesses on Alpha and possible other platforms.
By using a pointer to struct dos_partition, we implicitly tell the
compiler that the pointer is 4-bytes aligned, even though we know
that's not the case. The fact that we only dereference the pointer
to access a byte-wide field (field dp_ptyp) is not a guarantee that
the compiler will in fact use a byte-wide load. On some platforms
it's more efficient to use long word or quad word loads and use
bit-shifting and bit-masking to get the intended byte. On those
platforms an misaligned load will be the result.
The fix is to use byte-wide pointer arithmetic based on sizeof() and
offsetof() to avoid invalid casts which avoids that the compiler
makes invalid assumptions.

Backtrace provided by: wilko@
MFC after: 1 week
2006-06-04 20:26:13 +00:00
..
2005-11-30 19:07:28 +00:00
2006-02-01 12:06:01 +00:00
2006-02-01 12:06:01 +00:00
2006-04-28 12:13:49 +00:00
2006-02-01 12:06:01 +00:00
2006-02-01 12:06:01 +00:00
2006-02-01 12:06:01 +00:00
2006-02-01 12:06:01 +00:00
2005-03-18 06:57:58 +00:00
2006-03-13 14:59:57 +00:00
2005-11-25 10:09:30 +00:00
2005-02-10 12:10:35 +00:00