aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar gingerBill 2018-05-10 06:54:53 +0100
committerGravatar GitHub 2018-05-10 06:54:53 +0100
commit5fb5aad99eef871fdd5da22d47dd56ca2f6ad648 (patch)
tree3a13f8d6cda797ccc37721399ee90deab8008fd7
parentMerge pull request #30 from terickson001/master (diff)
parentFixed indentation (diff)
Merge pull request #34 from terickson001/memcopy_fix
gb_memcopy fix to return correct destination
Diffstat (limited to '')
-rw-r--r--gb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gb.h b/gb.h
index 8b3304d..25cc1d9 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;