Closed
Bug 1454512
Opened 7 years ago
Closed 7 years ago
rust is_symbol predicate broken on amd64
Categories
(Core :: JavaScript Engine, enhancement, P2)
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: terpri, Assigned: terpri)
Details
Attachments
(1 file, 1 obsolete file)
3.15 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
The is_symbol predicate in the Rust bindings doesn't work correctly on 64-bit systems. It compares the entire value against a shifted type tag, similar to the predicates for null and undefined, but it should ignore the value's payload (the symbol pointer).
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
Comment on attachment 8968357 [details] [diff] [review]
Fix JS::Value's is_symbol predicate.
Extract the type tag from the value in is_symbol and add a test case for it.
Attachment #8968357 -
Flags: review?(sphink)
Comment 3•7 years ago
|
||
Comment on attachment 8968357 [details] [diff] [review]
Fix JS::Value's is_symbol predicate.
Review of attachment 8968357 [details] [diff] [review]:
-----------------------------------------------------------------
Nice, with a patch and everything. Thanks!
::: js/rust/tests/value.rs
@@ +26,5 @@
> + );
> + rooted!(in(cx) let mut rval = UndefinedValue());
> + assert!(rt.evaluate_script(global.handle(), "Symbol('test')",
> + "test", 1, rval.handle_mut()).is_ok());
> + assert!(rval.is_symbol());
Can you add a negative test as well? A string seems best.
Attachment #8968357 -
Flags: review?(sphink) → review+
Updated•7 years ago
|
Priority: -- → P2
Assignee | ||
Comment 4•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Attachment #8968357 -
Attachment is obsolete: true
Assignee | ||
Comment 5•7 years ago
|
||
(In reply to Steve Fink [:sfink] [:s:] (PTO Apr9-12) from comment #3)
> Comment on attachment 8968357 [details] [diff] [review]
> Fix JS::Value's is_symbol predicate.
>
> Review of attachment 8968357 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Nice, with a patch and everything. Thanks!
>
> ::: js/rust/tests/value.rs
> @@ +26,5 @@
> > + );
> > + rooted!(in(cx) let mut rval = UndefinedValue());
> > + assert!(rt.evaluate_script(global.handle(), "Symbol('test')",
> > + "test", 1, rval.handle_mut()).is_ok());
> > + assert!(rval.is_symbol());
>
> Can you add a negative test as well? A string seems best.
Sure, added in the new patch. (the tests could also be merged into a single #[test] function if that is better style)
Assignee | ||
Updated•7 years ago
|
Attachment #8968768 -
Flags: review?(sphink)
Updated•7 years ago
|
Attachment #8968768 -
Flags: review?(sphink)
Attachment #8968768 -
Flags: review+
Attachment #8968768 -
Flags: checkin?
Comment 6•7 years ago
|
||
(In reply to Robin Templeton from comment #5)
> Sure, added in the new patch. (the tests could also be merged into a single
> #[test] function if that is better style)
I have no clue, I've never looked at a rust test before. I have no issue with landing this as-is, though. Thanks!
Updated•7 years ago
|
Assignee: nobody → robin
Comment 7•7 years ago
|
||
Comment on attachment 8968768 [details] [diff] [review]
Fix JS::Value's is_symbol predicate.
Please use checkin-needed, it works better with the automated bug marking tools.
Attachment #8968768 -
Flags: checkin?
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fd6fc6aa6448
Fix JS::Value's is_symbol predicate. r=sfink
Comment 9•7 years ago
|
||
bugherder |
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•