Open Bug 226403 Opened 22 years ago Updated 3 years ago

Wrong data type in getAsInt8 nsIVariant interface

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

REOPENED

People

(Reporter: phnixwxz1, Unassigned)

References

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Build Identifier: In interface nsIVariant: PRUint8 getAsInt8(); PRUint8 should be PRInt8. Also in interface nsIWritableVariant.getAsInt8. Reproducible: Always Steps to Reproduce:
I noticed the workaround of this bug in js/src/xpconnect/tests/components/xpctest_variant.cpp. I wonder whether PRUint8 in nsIVariant.setAsInt8 is with intent.
Summary: Wrong data type in getAsInt8 nsIVarient inteface → Wrong data type in getAsInt8 nsIVarient interface

Nika noticed this issue again recently.

This is also kind of an issue because ConvertToInt8 is implemented as though it was int8, so I guess there's some undefined behavior here:

NUMERIC_CONVERSION_METHOD_NORMAL(VTYPE_INT8, uint8_t, Int8, (-127 - 1), 127)

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: EXPIRED → ---
Summary: Wrong data type in getAsInt8 nsIVarient interface → Wrong data type in getAsInt8 nsIVariant interface
Assignee: doug.turner → nobody
Severity: normal → S3
Priority: -- → P3
OS: Windows XP → All
Hardware: x86 → All

Do we even need this? No one use this method.

Yeah, I think there's a decent argument for getting rid of int8, unint8, int16, uint16, char and wchar options from the interface.

See Also: → 1753476

I filed bug 1753476 about removing things from nsIVariant.

You need to log in before you can comment on or make changes to this bug.