DiscussionsIssue archiveOCCT:Application Framework

Archived issue #0027426

FSD_BinaryFile: Assignment to a temporary handle variable

Open CASCADEOCCT:Application Frameworkclosed7 public notes

Search issues

Description

The line 689 of the current version of the file FSD_BinaryFile.cxx looks like this:

      iData->ReadArray() = new Storage_HPArray(1, theData->NumberOfObjects());

But the method ReadArray() of the class Storage_InternalData returns handle by value. So, this assignment will no take any effect, and the logic of the code becomes ill.

This code was integrated with the fix to the bug #26229.

Steps to reproduce

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 1
This code seems to be dead: apart of apparent bug in initialization of a field, another problem is that this field (Storage_InternalData::myReadArray, accessed by method ReadArray()) is nowhere used outside of FSD_BinaryFile::ReadCompleteInfo(), and there is no known test cases when that code using it is activated... This is to be investigated further.
02Commenter 2
I'm assigning this ticket to you Sergey because ibs is no longer in the company. I don't even know who is it :)
03Commenter 2
Branch [archived branch] has been created by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: Vlad Romashko
Date: Mon Dec 14 13:18:27 2020 +0300

    0027426: FSD_BinaryFile: Assignment to a temporary handle variable
    
    A reference is added to the returning object of the method Storage_InternalData::ReadArray().
    Modified files:
    - Storage_InternalData.hxx
    
    OCCT: CR27426
    Products: nothing
04Commenter 4
Reviewed
OCCT branch: [archived branch]
Products branch: [archived branch]
05Commenter 3
Vlad, have you considered a comment left by Andrey, that the code seems nowhere used / not covered by any tests?
06Commenter 1
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17709.570000000054 / 17744.450000000124 [-0.20%]
Products
Total CPU difference: 12258.480000000121 / 12330.210000000125 [-0.58%]
Windows-64-VC14:
OCCT
Total CPU difference: 19272.796875 / 19429.1875 [-0.80%]
Products
Total CPU difference: 13712.859375 / 13755.5 [-0.31%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
07Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]