Skip to content

Incorrect handling of left shift overflow on non-x86_64 (returns value instead of runtime error) #1315

@jcpunk

Description

@jcpunk

Summary

On non-x86_64 architectures, Jsonnet does not raise a runtime error for integer left shift overflow. Instead, it returns a wrapped negative value and exits successfully (code 0). This contradicts expected behavior and causes regression test failure.

Affected Version:

Reproduction:

jsonnet --ext-str var1=test --ext-code var2='{x:1,y:2}' error.integer_left_shift_runtime.jsonnet

Test case (error.integer_left_shift_runtime.jsonnet):

(1 << 63)

Built at:
https://koji.fedoraproject.org/koji/taskinfo?taskID=143856013
https://koji.fedoraproject.org/koji/taskinfo?taskID=143856014
https://koji.fedoraproject.org/koji/taskinfo?taskID=143856015

Which contains both a root.log showing installed packages and a build.log showing the output from the compile/test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions