char array doesn't pass from C++ to Java

VERIFIED FIXED

Status

Core Graveyard
Java to XPCOM Bridge
P3
normal
VERIFIED FIXED
18 years ago
4 years ago

People

(Reporter: Oleg Khokhlov, Assigned: Igor Kushnirskiy)

Tracking

Trunk
x86
Windows NT

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
When an array of chars is transferred from C++ xpcom object to Java xpcom object  
 only the first element is transferred correctly.

Platform: WinNT 4.0 with SP 4. Mozilla PR3. BlackConnect source from 10/22/00.
(Reporter)

Comment 1

18 years ago
Not only the first element is transferred correctly, but:

1. When char array is transferred from C++ xpcom object to Java xpcom object   
(java method is invoked from C++ via in parameter), then every fourth element   
is transferred:

 original array = 
{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a', 
'b', 'c', 'd', 'e', 'f', 'g'}; 
 result array = {'1','5','9','c','g','garbage','garbage',...}

2. When char array is transferred from Java xpcom object to C++ xpcom object     
(c++ method is invoked from java via in parameter), then result array is:

 result array = {'1', 'garbage', 'garbage', 'garbage', '2', 'garbage', 
'garbage', 'garbage', '3', 'garbage', ...}

It seems than 4 bytes are used for every element of array.
(Assignee)

Comment 2

18 years ago
I can not reproduce the bug on linux on my own tests.

What platform are you using? May I have tests you are using?

Thanks,   
   -Igor
(Assignee)

Comment 3

18 years ago
Did you test it only on winNT?
(Assignee)

Comment 4

18 years ago
fixed, integrated into the trunc
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Reporter)

Comment 5

17 years ago
I mark it as verified.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.