Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console: Weird behaviours and crashes when redefining action! used by console #1127

Closed
x8x opened this issue Apr 27, 2015 · 4 comments
Closed
Labels
status.resolved Issue has been resolved without a change in the source code (should be elaborated in comments).
Milestone

Comments

@x8x
Copy link
Contributor

x8x commented Apr 27, 2015

executing following code in the console:

]
trim: func [a /head][
    c: func [d][]
    head
    a
]
]

returns:

red>> ]
*** Syntax error: missing [ at ]
*** Where: do
red>> trim: func [a /head][
[     c: func [d][]
[     head
[     a
[    ]
== func [a /head][c: func [d] [] head a]
red>> ]

*** Runtime Error 1: access violation
*** at: 0001FCACh
@x8x x8x changed the title red/console wired crash red/console wierd crash Apr 27, 2015
@x8x
Copy link
Contributor Author

x8x commented Apr 27, 2015

no crash but wierd:

  % red
--== Red 0.5.3 ==-- 
Type HELP for starting information. 

red>> ]
*** Syntax error: missing [ at ]
*** Where: do
red>> trim: does []
== func [][]
red>> ]
*** Script error: arg1 has no value
*** Where: arg1
red>> 
  % red
--== Red 0.5.3 ==-- 
Type HELP for starting information. 

red>> trim: does []
== func [][]
red>> ]
*** Script error: trim has no refinement called trim
*** Where: trim
red>> 

@x8x
Copy link
Contributor Author

x8x commented Apr 27, 2015

btw,

red>> source trim
Sorry, trim is a action! so no source is available

should be either
Sorry, trim is an action! so no source is available
or
Sorry, trim is a value of type action! so no source is available
or
Sorry, no source available for trim of type action!

@dockimbel
Copy link
Member

Fixed the error message:

red>> source append
Sorry, append is an action! so no source is available
red>> source +
Sorry, + is an op! so no source is available
red>> source equal?
Sorry, equal? is a native! so no source is available

@dockimbel
Copy link
Member

About the "weird crashes", they happen because you redefine an action! of the Red language which is used internally by the console code. You are allowed to do that, but at your own risks. ;-)

We will have a protection system for words in the future, to protect by default users to shoot themselves in the foot and increase security when loading untrusted code.

@dockimbel dockimbel added status.resolved Issue has been resolved without a change in the source code (should be elaborated in comments). Red labels Apr 28, 2015
@dockimbel dockimbel added this to the 0.5.4 milestone Apr 28, 2015
@x8x x8x changed the title red/console wierd crash Console: Weird behaviours and crashes when redefining action! used by console Apr 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status.resolved Issue has been resolved without a change in the source code (should be elaborated in comments).
Projects
None yet
Development

No branches or pull requests

2 participants