Limits check in assembler seemed to break on 32 bit systems, fixed
Fix: Replaced the integer literals with macros from the <climits.h> library.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* - checking instruction parameters for their validity
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include "../inc/msg.h"
|
||||
#include "../inc/global.h"
|
||||
|
||||
@@ -58,7 +59,7 @@ int unsigned4(int imm) {
|
||||
* imm: immediate to be checked
|
||||
*/
|
||||
int word(int imm) {
|
||||
if ((imm >= -2147483648) && (imm <= 2147483647)) {
|
||||
if ((imm >= INT_MIN) && (imm <= INT_MAX)) {
|
||||
// in valid range
|
||||
return imm;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user