aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tyler Erickson 2018-05-09 19:35:06 -0700
committerGravatar Tyler Erickson 2018-05-09 19:35:06 -0700
commit95ed1f5de3e4ecf4c3e66857e79f3cdddcecfe3e (patch)
tree78564f5aecd66eb0d11e898bf639e9052566b792
parentMerge pull request #30 from terickson001/master (diff)
gb_memcopy now returns the correct dest
-rw-r--r--gb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gb.h b/gb.h
index 8b3304d..1f8025c 100644
--- a/gb.h
+++ b/gb.h
@@ -3673,7 +3673,8 @@ gb_inline void *gb_memcopy(void *dest, void const *source, isize n) {
return NULL;
}
- __asm__ __volatile__("rep movsb" : "+D"(dest), "+S"(source), "+c"(n) : : "memory");
+ void *dest_copy = dest;
+ __asm__ __volatile__("rep movsb" : "+D"(dest_copy), "+S"(source), "+c"(n) : : "memory");
#else
u8 *d = cast(u8 *)dest;
u8 const *s = cast(u8 const *)source;