Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unsigned to represent memory flags size #159

Closed
wants to merge 1 commit into from

Conversation

JetXujing
Copy link

@JetXujing JetXujing commented Apr 17, 2023

Left shift of WORD_SIZE and INT_SIZE by 30 places cannot be represented in type 'int'. Using 'unsigned int' instead.

@carenas
Copy link
Contributor

carenas commented Apr 17, 2023

this should also affect INT_SIZE so wouldn't it be better to approach it instead with at least something like:

diff --git a/sljit_src/sljitNativeARM_64.c b/sljit_src/sljitNativeARM_64.c
index d1a65fd..4da351a 100644
--- a/sljit_src/sljitNativeARM_64.c
+++ b/sljit_src/sljitNativeARM_64.c
@@ -937,10 +937,10 @@ set_flags:
 #define STORE          0x10
 #define SIGNED         0x20
 
-#define BYTE_SIZE      0x0
-#define HALF_SIZE      0x1
-#define INT_SIZE       0x2
-#define WORD_SIZE      0x3
+#define BYTE_SIZE      0x0u
+#define HALF_SIZE      0x1u
+#define INT_SIZE       0x2u
+#define WORD_SIZE      0x3u
 
 #define MEM_SIZE_SHIFT(flags) ((sljit_ins)(flags) & 0x3)
 

@JetXujing
Copy link
Author

Yes, I agree with you and I have made the relevant changes. In addition, the input parameters of some functions and variable types are adjusted to avoid implicit conversion.

@JetXujing JetXujing changed the title Left shift of WORD_SIZE by 30 places cannot br represented in type 'int' Use unsigned to represent memory flags size Apr 18, 2023
Left shift of WORD_SIZE and INT_SIZE by 30 places cannot be represented
in type 'int'. Using 'unsigned int' instead.
@JetXujing JetXujing closed this Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants