Skip to content

Commit

Permalink
get rid of uptrval
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellerozenblit committed Mar 29, 2023
1 parent 4b1771a commit 62dd65f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion contrib/linux-kernel/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ typedef uint32_t U32;
typedef int32_t S32;
typedef uint64_t U64;
typedef int64_t S64;
typedef uintptr_t uptrval;

/*-**************************************************************
* Memory I/O API
Expand Down
2 changes: 0 additions & 2 deletions lib/common/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ extern "C" {
typedef int32_t S32;
typedef uint64_t U64;
typedef int64_t S64;
typedef uintptr_t uptrval;
#else
# include <limits.h>
#if CHAR_BIT != 8
Expand All @@ -82,7 +81,6 @@ extern "C" {
* limits exist in C99, however, in such case, <stdint.h> is preferred */
typedef unsigned long long U64;
typedef signed long long S64;
typedef size_t uptrval; /* generally true, except OpenVMS-64 */
#endif


Expand Down
5 changes: 2 additions & 3 deletions lib/decompress/zstd_decompress_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,9 +2124,8 @@ ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,
ip += seqHSize;
srcSize -= seqHSize;

RETURN_ERROR_IF(dst == NULL && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
RETURN_ERROR_IF(dstCapacity == 0 && nbSeq > 0, dstSize_tooSmall, "dstCapacity == 0, but nbSeq is non-zero");
RETURN_ERROR_IF(MEM_64bits() && (uptrval)dst + dstCapacity > (uptrval)-1 - (1 << 20), dstSize_tooSmall,
RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
RETURN_ERROR_IF(MEM_64bits() && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,
"invalid dst");

/* If we could potentially have long offsets, or we might want to use the prefetch decoder,
Expand Down

0 comments on commit 62dd65f

Please sign in to comment.