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

HPCC-32826 Avoid integer underflow when calculating elapsed cycles #19208

Open
wants to merge 1 commit into
base: candidate-9.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/include/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ typedef unsigned __int64 hash64_t;
typedef unsigned __int64 __uint64;
typedef __uint64 offset_t;
typedef unsigned char byte;
typedef __int64 cycle_t;
typedef __uint64 cycle_t; // This must be unsigned to avoid integer overflow issues when subtracting
typedef unsigned __int64 timestamp_type;

// BUILD_TAG not needed here anymore - defined in build_tag.h
Expand Down
4 changes: 2 additions & 2 deletions system/jlib/jdebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ class TimeSectionInfo : public MappingBase
unsigned getCount() const { return count; }

StringAttr scope;
__int64 totalcycles;
__int64 maxcycles;
cycle_t totalcycles;
cycle_t maxcycles;
unsigned count;
};

Expand Down
Loading