Giter VIP home page Giter VIP logo

scil's People

Contributors

mclc avatar sahb1239 avatar simonellegaard avatar thomaspilgaard avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

scil's Issues

Wrong code generated

The following C# code

using System;

namespace SimpleCILProgram
{
    class Program
    {
        static void Main(string[] args)
        {
            var read = (int)Console.ReadKey().KeyChar;

            var lal = read + 7;

            Console.WriteLine(MakeText(AddTen(lal)));
        }

        static int AddTen(int i)
        {
            return i + 10;
        }

        static string MakeText(int i)
        {
            return $"Your number was: {i}";
        }
    }

}

generates the following Flix code

// method_MakeText<>(System.Int32 i)
// Begin block (first offset: 0)
// Node ldstr, offset: 0, pop: 0, push: 1
LdstrStm("SimpleCILProgram.Program::MakeText(System.Int32)_0_0", "Your number was: {0}").
// Node ldarg, offset: 5, pop: 0, push: 1
LdargStm("SimpleCILProgram.Program::MakeText(System.Int32)_1_0", "SimpleCILProgram.Program::MakeText(System.Int32)", 0).
// Node box, offset: 6, pop: 1, push: 1
// box
// Node call, offset: 11, pop: 2, push: 1
StargStm("System.String::Format(System.String,System.Object)", "SimpleCILProgram.Program::MakeText(System.Int32)_0_0", 0, "System.String").
** StargStm("System.String::Format(System.String,System.Object)", "SimpleCILProgram.Program::MakeText(System.Int32)_1_1", 1, "System.Object") .**
CallStm("SimpleCILProgram.Program::MakeText(System.Int32)_0_1", "RET_System.String::Format(System.String,System.Object)", "System.String::Format(System.String,System.Object)", "System.String").
// Node ret, offset: 16, pop: 0, push: 0
RetStm("RET_SimpleCILProgram.Program::MakeText(System.Int32)", "SimpleCILProgram.Program::MakeText(System.Int32)_0_1").
// End block (last offset: 16)

The lines marked with ** is wrong because of a wrong number in the stack value parameter. Instead of "SimpleCILProgram.Program::MakeText(System.Int32)_1_1", it should be "SimpleCILProgram.Program::MakeText(System.Int32)_1_0" since the LdargStm loaded the argument value into that one.

Invalid cast

ControlFlowGraph.cs linje 77 laver et invalid cast.

Den forsøger at caste Operand til Instruction, men I nogle tilfælde (eksempelvis Akuthjælp app) er Operand et array af Instructions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.