# SDL: Fixed ASAN warning, runtime error: left shift of 160 by 24 places cannot be represented in type 'int' (01fa4)

**URL:** <https://discourse.libsdl.org/t/sdl-fixed-asan-warning-runtime-error-left-shift-of-160-by-24-places-cannot-be-represented-in-type-int-01fa4/48269>\
**Category:** SDL Commits\
**Created:** [January 11, 2024, 5:04pm UTC](https://discourse.libsdl.org/t/sdl-fixed-asan-warning-runtime-error-left-shift-of-160-by-24-places-cannot-be-represented-in-type-int-01fa4/48269 "2024-01-11T17:04:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [January 11, 2024, 5:04pm UTC](https://discourse.libsdl.org/t/sdl-fixed-asan-warning-runtime-error-left-shift-of-160-by-24-places-cannot-be-represented-in-type-int-01fa4/48269/1 "2024-01-11T17:04:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/01fa4dd9d16751d5ba7576d9c76215acc0b243af>
>
> (cherry picked from commit cf0d1d7234e4ce1cc05d4e0ff1517c33363dfe7b)

```diff
From 01fa4dd9d16751d5ba7576d9c76215acc0b243af Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Thu, 11 Jan 2024 09:26:55 +0100
Subject: [PATCH] Fixed ASAN warning, runtime error: left shift of 160 by 24
 places cannot be represented in type 'int'

(cherry picked from commit cf0d1d7234e4ce1cc05d4e0ff1517c33363dfe7b)
---
 test/testautomation_guid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/testautomation_guid.c b/test/testautomation_guid.c
index cf99dea8139a..81e60e8f4ba9 100644
--- a/test/testautomation_guid.c
+++ b/test/testautomation_guid.c
@@ -125,7 +125,7 @@ TestGuidToString(void *arg)
             SDL_GUIDToString(guid, guid_str, size);
 
             /* Check bytes before guid_str_buf */
- expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (fill_char << 24);
+ expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (((Uint32)fill_char) << 24);
             SDL_memcpy(&actual_prefix, guid_str_buf, 4);
             SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32 ", at size=%d", expected_prefix, actual_prefix, size);
 

```
