mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Replace memcpys by a static_cast and an integral promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
197616adda
commit
f6b6c37ca2
@ -785,15 +785,13 @@ namespace yaml {
|
||||
// Type of "flags" field varies depending on "kind" field.
|
||||
// Use memcpy here to avoid breaking strict aliasing rules.
|
||||
if (kf.kind == kindA) {
|
||||
AFlags aflags;
|
||||
memcpy(&aflags, &kf.flags, sizeof(aflags));
|
||||
AFlags aflags = static_cast<AFlags>(kf.flags);
|
||||
io.mapRequired("flags", aflags);
|
||||
memcpy(&kf.flags, &aflags, sizeof(kf.flags));
|
||||
kf.flags = aflags;
|
||||
} else {
|
||||
BFlags bflags;
|
||||
memcpy(&bflags, &kf.flags, sizeof(bflags));
|
||||
BFlags bflags = static_cast<BFlags>(kf.flags);
|
||||
io.mapRequired("flags", bflags);
|
||||
memcpy(&kf.flags, &bflags, sizeof(kf.flags));
|
||||
kf.flags = bflags;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user