Skip to content

Commit 5f694e1

Browse files
committed
Avoid infinite loop when reading assembly file
When reading in shared data from an assembly file, the loop (weirdly...) uses a left shift instead of a normal iteration when determining the assembly datatype. However, it started the loop variable at 0, so it would remain at 0 after a left shift and loop infinitely. This sets the loop variable to 1, which seems to have been the intention since the cGasTypes contains empty dummy entries to accommodate the shift method.
1 parent 81fc1ab commit 5f694e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libgrit/pathfun.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ bool im_data_gas(FILE* fp, const char* name, const void *_data, int *len, int *c
869869
search[1] = 0;
870870
if(sscanf(tread, ".%s 0x", search+1))
871871
{
872-
for(i=0; i<5; i<<=1) {
872+
for(i=1; i<5; i<<=1) {
873873
if(!strcmp(search, cGasTypes[i]))
874874
{
875875
_chunk = i;

0 commit comments

Comments
 (0)