mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-05 23:22:25 +00:00
Merge pull request #111 from InnaKhachikyan/master
modified Index checking to handle run-time variable index containing …
This commit is contained in:
commit
94683df1d8
1 changed files with 5 additions and 3 deletions
|
|
@ -116,9 +116,11 @@ extern void Modules_AssertFail(INT32 x);
|
|||
|
||||
// Index checking
|
||||
|
||||
static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;}
|
||||
#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0))
|
||||
|
||||
static inline INT64 __XF(INT64 i, UINT64 ub) {
|
||||
if (i < 0 || (UINT64)i >= ub) __HALT(-2);
|
||||
return i;
|
||||
}
|
||||
#define __X(i, ub) (((i) >= 0 && (i) < (ub)) ? (i) : (__HALT(-2),0))
|
||||
|
||||
// Range checking, and checked SHORT and CHR functions
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue