Ticket #1811 (closed bug: fixed)

Opened 11 years ago

Last modified 10 years ago

r48674 broke int/float division in partcl-old

Reported by: coke Owned by: whiteknight
Priority: normal Milestone:
Component: core Version: trunk
Severity: medium Keywords:
Cc: chromatic Language: tcl
Patch status: Platform:

Description (last modified by coke) (diff)

./tclsh -e "puts [expr 1/3.0]"

used to print "0.33333" or so (a floating point value) Now it prints "0" (an int)

this was introduced in parrot r48674, which touched the integer PMC.

Change History

Changed 11 years ago by coke

  • description modified (diff)

Changed 11 years ago by coke

(at a guess, it's because init_int doesn't respect the HLL mapped types.)

Changed 11 years ago by coke

  • lang set to tcl

Changed 11 years ago by coke

On Tue, Oct 5, 2010 at 5:23 PM, chromatic <chromatic@wgz.org> wrote:
> On Saturday 02 October 2010 at 22:54, Parrot  wrote:
>
>>  (at a guess, it's because init_int doesn't respect the HLL mapped types.)
>
> I don't immediately see how this could be from reading the code and the diff.
> Can you provide some PIR which worked before and doesn't work after r48674 as
> a test case?

Not without a lot more work, so I'll add it to my queue but I can't
imagine I'll get to it soon.

-- 
Will "Coke" Coleda

Changed 11 years ago by coke

if I try to run the tcl above with

parrot -t5 tcl.pbc  -e "puts [expr 1/3.0]"

I get a segfault, so it's going to be hard to track down the actual PIR that's being generated.

Changed 11 years ago by whiteknight

  • owner set to whiteknight

Changed 11 years ago by bacek

Hello.

"Workaround" for this bug was committed into partcl-old. Still not sure is parrot behavior is sane.

In the nutshell: MMD selects Integer.divide(DEFAULT) for TclInt divide by TclFloat. Looks like previously Float.devide(Float) was selected.

-- Bacek

Changed 10 years ago by whiteknight

  • status changed from new to closed
  • resolution set to fixed

bacek says he committed a fix and I don't see any further complaints. I'm closing this ticket.

The Parrot behavior here is indeed a little suspect, but I think much of it will come out when we redo our object model. We can address these issues during that work.

Note: See TracTickets for help on using tickets.