Bug 25781 - SprmUtils.addSprm gets wrong instruction type
Summary: SprmUtils.addSprm gets wrong instruction type
Alias: None
Product: POI
Classification: Unclassified
Component: HDF (show other bugs)
Version: 2.0-dev
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2003-12-28 14:05 UTC by Simon Niederberger
Modified: 2008-12-01 23:19 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Simon Niederberger 2003-12-28 14:05:37 UTC
From how I understand the code in SprmUtils.addSprm, the (instruction) type is 
derived from the highest three bits of the passed instruction. However, the 
bits are not right-shifted after the bit-and.

    int type = instruction & 0xe000;
    // SIN, ADD BEG
    // I guess the code is meant to read the top 3 bits and pack them in an 
int 0-7
    type >>= 13;
    // SIN, ADD END

(If this isn't bug report doesn't meet your standards, my apologies - just 
submitting my first one ...)

Comment 1 Ryan Ackley 2003-12-28 14:35:31 UTC
Good catch. Oddly I had already fixed it on my local machine. I am actually 
working on HWPF this morning. Thanks for the bug report and keep them coming!! 
Comment 2 Josh Micich 2008-12-01 23:19:54 UTC
Fix was applied in svn r353484