浏览代码

* BugFix: Correct an ASAN reported memory error caused by incorrect usage of __sync_fetch_and_add.

Robert MacGregor 3 年之前
父节点
当前提交
2311d7d683
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Engine/source/platform/platformIntrinsics.gcc.h

+ 1 - 1
Engine/source/platform/platformIntrinsics.gcc.h

@@ -79,7 +79,7 @@ inline bool dCompareAndSwap( volatile U64& ref, U64 oldVal, U64 newVal )
 inline U32 dAtomicRead( volatile U32 &ref )
 {
    #if !defined(TORQUE_OS_MAC)
-      return __sync_fetch_and_add( ( volatile long* ) &ref, 0 );
+      return __sync_fetch_and_add( &ref, 0 );
    #else
       return OSAtomicAdd32( 0, (int32_t* ) &ref);
    #endif