Skip to content

generator.generate_slice_for_vector function only handles .c files. #12

@RobotSail

Description

@RobotSail

Hello,

I recently ran into an error generating a patch for a repository where changes were made to both header and implementation files. It seems like the error is rooted in the implementation of the generate_slice_for_vector function in app/tools/generator.py, where it expects the vector path to contain a .c file:

def generate_slice_for_vector(vector_path, use_macro=False):
    # ...
    source_file, segment = vector_path.split(".c.")
    # ...

However, this breaks when FixMorph passes it a vectorfile that was constructed from a header file: /dirs/iotop-c-a/src/iotop.h.func_humanize_val.vec:

                        [ERROR] Crash during finding segment clones in target, after 0.100 minutes.
                        [ERROR] Transformation Failed
                        [ERROR] not enough values to unpack (expected 2, got 1)
                        [ERROR] Unexpected error during finding segment clones in target.
                        [ERROR] Runtime Error
                        [ERROR] Error. Exiting...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions