Skip to content

time: integer overflow in ParseDuration #3374

@gopherbot

Description

@gopherbot

by jsawczuk:

Using the weekly.2012-03-13 build, I'm trying to parse some duration strings and came up
with what I think are unexpected results. I've attached a source file with 4 test cases,
in which cases 1 and 3 fail, but 2 and 4 succeed. I haven't been able to find in
documentation why this would be the case.

What steps will reproduce the problem?
1. Run the attached file which specify the test cases.

What is the expected output?
I would expect all four cases to succeed in returning valid durations.

What do you see instead?
Cases 1 and 3 fail, while cases 2 and 4 succeed.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Tested on Mac OS X and Ubuntu Linux (64-bit)

Which revision are you using?  (hg identify)
3cdba7b0650c weekly/weekly.2012-03-13

Please provide any additional information below.



Let me know if I can provide any further information or if I'm missing something here.

Attachments:

  1. duration.go (423 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions